diff options
Diffstat (limited to 'fs/xfs/scrub/common.c')
-rw-r--r-- | fs/xfs/scrub/common.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c index f5df8f2859d7..8033ab9d8f47 100644 --- a/fs/xfs/scrub/common.c +++ b/fs/xfs/scrub/common.c | |||
@@ -756,3 +756,26 @@ xfs_scrub_should_check_xref( | |||
756 | *error = 0; | 756 | *error = 0; |
757 | return false; | 757 | return false; |
758 | } | 758 | } |
759 | |||
760 | /* Run the structure verifiers on in-memory buffers to detect bad memory. */ | ||
761 | void | ||
762 | xfs_scrub_buffer_recheck( | ||
763 | struct xfs_scrub_context *sc, | ||
764 | struct xfs_buf *bp) | ||
765 | { | ||
766 | xfs_failaddr_t fa; | ||
767 | |||
768 | if (bp->b_ops == NULL) { | ||
769 | xfs_scrub_block_set_corrupt(sc, bp); | ||
770 | return; | ||
771 | } | ||
772 | if (bp->b_ops->verify_struct == NULL) { | ||
773 | xfs_scrub_set_incomplete(sc); | ||
774 | return; | ||
775 | } | ||
776 | fa = bp->b_ops->verify_struct(bp); | ||
777 | if (!fa) | ||
778 | return; | ||
779 | sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT; | ||
780 | trace_xfs_scrub_block_error(sc, bp->b_bn, fa); | ||
781 | } | ||