From: Darrick J. Wong Date: Thu, 4 Jun 2026 06:08:29 +0000 (-0700) Subject: xfs_scrub: don't continue with phase1 if autofsck=none X-Git-Tag: v7.1.0~51 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d0b07b57faf00fddc720000c7546d4d8293c22c1;p=xfsprogs-dev.git xfs_scrub: don't continue with phase1 if autofsck=none 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" Reviewed-by: Andrey Albershteyn --- diff --git a/scrub/phase1.c b/scrub/phase1.c index f4d50d01..9e60a4d9 100644 --- a/scrub/phase1.c +++ b/scrub/phase1.c @@ -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) ||