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>
*/
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) ||