]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_scrub: don't continue with phase1 if autofsck=none
authorDarrick J. Wong <djwong@kernel.org>
Thu, 4 Jun 2026 06:08:29 +0000 (23:08 -0700)
committerAndrey Albershteyn <aalbersh@kernel.org>
Thu, 11 Jun 2026 10:26:04 +0000 (12:26 +0200)
If xfs_scrub was started with -o autofsck and the filesystem's autofsck
property says not to run xfs_scrub, we should exit phase 1 early so that
the rest of the validation checks don't need to run.  Codex points out
that the current code can fail pointlessly in this manner.

Cc: linux-xfs@vger.kernel.org # v6.10.0
Fixes: 9451b5ee0d0d2d ("xfs_scrub: allow sysadmin to control background scrubs")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
scrub/phase1.c

index f4d50d016c2ebd4fa7c20e97ef137654626d4663..9e60a4d948f2db515b99f10449dd528eec9118a3 100644 (file)
@@ -342,6 +342,8 @@ _("Not an XFS filesystem."));
         */
        if (ctx->mode == SCRUB_MODE_NONE)
                mode_from_autofsck(ctx);
+       if (ctx->mode == SCRUB_MODE_NONE)
+               return 0;
 
        /* Do we have kernel-assisted metadata scrubbing? */
        if (!can_scrub_fs_metadata(ctx) || !can_scrub_inode(ctx) ||