From: Darrick J. Wong Date: Sun, 22 Feb 2026 22:41:18 +0000 (-0800) Subject: mkfs: enable online repair if all backrefs are enabled X-Git-Tag: v7.0.0~33 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8aed3354e42933ccfc8ca870f9a0911efe0c3a3d;p=xfsprogs-dev.git mkfs: enable online repair if all backrefs are enabled If all backreferences are enabled in the filesystem, then enable online repair by default if the user didn't supply any other autofsck setting. Users might as well get full self-repair capability if they're paying for the extra metadata. Note that it's up to each distro to enable the systemd services according to their own service activation policies. Debian policy is to enable all systemd services at package installation but they don't enable online fsck in their Kconfig so the services won't activate. RHEL and SUSE policy requires sysadmins to enable them explicitly unless the OS vendor also ships a systemd preset file enabling the services. Distros without systemd won't get any of the systemd services, obviously. Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 527a662f..f859626a 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -6296,6 +6296,15 @@ main( if (mp->m_sb.sb_agcount > 1) rewrite_secondary_superblocks(mp); + /* + * If the filesystem has full backreferences and the user didn't + * express an autofsck preference, enable online repair because they + * might as well get some useful functionality from the extra metadata. + */ + if (cli.autofsck == FSPROP_AUTOFSCK_UNSET && + cli.sb_feat.rmapbt && cli.sb_feat.parent_pointers) + cli.autofsck = FSPROP_AUTOFSCK_REPAIR; + if (cli.autofsck != FSPROP_AUTOFSCK_UNSET) set_autofsck(mp, &cli);