diff options
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r-- | fs/xfs/scrub/common.h | 3 | ||||
-rw-r--r-- | fs/xfs/scrub/scrub.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/fs/xfs/scrub/common.h b/fs/xfs/scrub/common.h index 70a42897cd22..dc7b2f41c1d2 100644 --- a/fs/xfs/scrub/common.h +++ b/fs/xfs/scrub/common.h @@ -194,7 +194,8 @@ static inline bool xfs_scrub_needs_repair(struct xfs_scrub_metadata *sm) { return sm->sm_flags & (XFS_SCRUB_OFLAG_CORRUPT | XFS_SCRUB_OFLAG_XCORRUPT | - XFS_SCRUB_OFLAG_PREEN); + XFS_SCRUB_OFLAG_PREEN | + XFS_SCRUB_IFLAG_FORCE_REBUILD); } int xchk_iwalk_find_next(struct xfs_mount *mp, struct xfs_trans *tp, diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c index d3944a1d0146..3a43fe95dfc8 100644 --- a/fs/xfs/scrub/scrub.c +++ b/fs/xfs/scrub/scrub.c @@ -476,6 +476,11 @@ xchk_validate_inputs( goto out; } + /* No rebuild without repair. */ + if ((sm->sm_flags & XFS_SCRUB_IFLAG_FORCE_REBUILD) && + !(sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR)) + return -EINVAL; + /* * We only want to repair read-write v5+ filesystems. Defer the check * for ops->repair until after our scrub confirms that we need to |