aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-02-12 15:47:56 -0600
committerEric Sandeen <sandeen@redhat.com>2018-02-12 15:47:56 -0600
commit2e4959c1c632c5faf5efff445429d3a4a5089f27 (patch)
tree287e2a99fdf67117cb536d86f07ed838a7516625
parentbb5dbd06b7265fbc56711f37db70e72a6fd854bf (diff)
downloadxfsprogs-dev-2e4959c1c632c5faf5efff445429d3a4a5089f27.tar.gz
xfs_scrub: always init phase information
Make sure we initialize the overall phase state before we start executing any code that can end up in the report-status-and-exit paths. Otherwise if debugging is turned on we get garbage io/cpu stat reports. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--scrub/xfs_scrub.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c
index 6efcf77e93..89b7fa0eca 100644
--- a/scrub/xfs_scrub.c
+++ b/scrub/xfs_scrub.c
@@ -618,6 +618,11 @@ main(
if (getenv("SERVICE_MODE"))
is_service = true;
+ /* Initialize overall phase stats. */
+ moveon = phase_start(&all_pi, 0, NULL);
+ if (!moveon)
+ return SCRUB_RET_OPERROR;
+
/* Find the mount record for the passed-in argument. */
if (stat(argv[optind], &ctx.mnt_sb) < 0) {
fprintf(stderr,
@@ -641,11 +646,6 @@ main(
mtab = _PATH_MOUNTED;
}
- /* Initialize overall phase stats. */
- moveon = phase_start(&all_pi, 0, NULL);
- if (!moveon)
- goto out;
-
ismnt = find_mountpoint(mtab, &ctx);
if (!ismnt) {
fprintf(stderr,