]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_scrub: automatic downgrades to dry-run mode in service mode
authorDarrick J. Wong <djwong@kernel.org>
Mon, 29 Jul 2024 23:23:18 +0000 (16:23 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:01:10 +0000 (17:01 -0700)
commit588e0462e1a93441f4017a6606a732fdef59d7f7
treed2eaa409d5158215f0ce51156fe23e84677886a3
parente17a7b1fefb2cc4078d58dc6dfb4061d973c21f1
xfs_scrub: automatic downgrades to dry-run mode in service mode

When service mode is enabled, xfs_scrub is being run within the context
of a systemd service.  The service description language doesn't have any
particularly good constructs for adding in a '-n' argument if the
filesystem is readonly, which means that xfs_scrub is passed a path, and
needs to switch to dry-run mode on its own if the fs is mounted
readonly or the kernel doesn't support repairs.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
scrub/phase1.c
scrub/repair.c
scrub/repair.h