xfs: implement the metadata repair ioctl flag
Plumb in the pieces necessary to make the "scrub" subfunction of the scrub ioctl actually work. This means that we make the IFLAG_REPAIR flag to the scrub ioctl actually do something, and we add an errortag knob so that xfstests can force the kernel to rebuild a metadata structure even if there's nothing wrong with it. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
@@ -65,7 +65,8 @@
|
||||
#define XFS_ERRTAG_LOG_BAD_CRC 29
|
||||
#define XFS_ERRTAG_LOG_ITEM_PIN 30
|
||||
#define XFS_ERRTAG_BUF_LRU_REF 31
|
||||
#define XFS_ERRTAG_MAX 32
|
||||
#define XFS_ERRTAG_FORCE_SCRUB_REPAIR 32
|
||||
#define XFS_ERRTAG_MAX 33
|
||||
|
||||
/*
|
||||
* Random factors for above tags, 1 means always, 2 means 1/2 time, etc.
|
||||
@@ -102,5 +103,6 @@
|
||||
#define XFS_RANDOM_LOG_BAD_CRC 1
|
||||
#define XFS_RANDOM_LOG_ITEM_PIN 1
|
||||
#define XFS_RANDOM_BUF_LRU_REF 2
|
||||
#define XFS_RANDOM_FORCE_SCRUB_REPAIR 1
|
||||
|
||||
#endif /* __XFS_ERRORTAG_H_ */
|
||||
|
@@ -542,13 +542,20 @@ struct xfs_scrub_metadata {
|
||||
/* o: Metadata object looked funny but isn't corrupt. */
|
||||
#define XFS_SCRUB_OFLAG_WARNING (1 << 6)
|
||||
|
||||
/*
|
||||
* o: IFLAG_REPAIR was set but metadata object did not need fixing or
|
||||
* optimization and has therefore not been altered.
|
||||
*/
|
||||
#define XFS_SCRUB_OFLAG_NO_REPAIR_NEEDED (1 << 7)
|
||||
|
||||
#define XFS_SCRUB_FLAGS_IN (XFS_SCRUB_IFLAG_REPAIR)
|
||||
#define XFS_SCRUB_FLAGS_OUT (XFS_SCRUB_OFLAG_CORRUPT | \
|
||||
XFS_SCRUB_OFLAG_PREEN | \
|
||||
XFS_SCRUB_OFLAG_XFAIL | \
|
||||
XFS_SCRUB_OFLAG_XCORRUPT | \
|
||||
XFS_SCRUB_OFLAG_INCOMPLETE | \
|
||||
XFS_SCRUB_OFLAG_WARNING)
|
||||
XFS_SCRUB_OFLAG_WARNING | \
|
||||
XFS_SCRUB_OFLAG_NO_REPAIR_NEEDED)
|
||||
#define XFS_SCRUB_FLAGS_ALL (XFS_SCRUB_FLAGS_IN | XFS_SCRUB_FLAGS_OUT)
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user