diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-04-11 19:00:04 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2023-04-11 19:00:04 -0700 |
commit | 69010fe3ac1fe9932a64268c32b67964fe5c06a8 (patch) | |
tree | 414c189b97bace8e2e22638a4c0ebb97f9d4390b /fs/xfs/scrub/bmap.c | |
parent | c4e34172da26cb57f56c471728853d3a428ec832 (diff) | |
download | lwn-69010fe3ac1fe9932a64268c32b67964fe5c06a8.tar.gz lwn-69010fe3ac1fe9932a64268c32b67964fe5c06a8.zip |
xfs: standardize ondisk to incore conversion for bmap btrees
Fix all xfs_bmbt_disk_get_all callsites to call xfs_bmap_validate_extent
and bubble up corruption reports.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/bmap.c')
-rw-r--r-- | fs/xfs/scrub/bmap.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c index a5078d63808f..6188eba672e5 100644 --- a/fs/xfs/scrub/bmap.c +++ b/fs/xfs/scrub/bmap.c @@ -471,6 +471,12 @@ xchk_bmapbt_rec( return 0; xfs_bmbt_disk_get_all(&rec->bmbt, &irec); + if (xfs_bmap_validate_extent(ip, info->whichfork, &irec) != NULL) { + xchk_fblock_set_corrupt(bs->sc, info->whichfork, + irec.br_startoff); + return 0; + } + if (!xfs_iext_lookup_extent(ip, ifp, irec.br_startoff, &icur, &iext_irec) || irec.br_startoff != iext_irec.br_startoff || |