]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
xfs: bmap scrub should only scrub records once
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 27 Aug 2019 00:06:00 +0000 (17:06 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 27 Aug 2019 00:43:15 +0000 (17:43 -0700)
commit519e5869d50d1e41b39cef4d757973469393fac7
treee2f7d472a958d242f4e61f6113dc315d34ade387
parent71912e08e06b7041ba3b40945328b84798dfe6fc
xfs: bmap scrub should only scrub records once

The inode block mapping scrub function does more work for btree format
extent maps than is absolutely necessary -- first it will walk the bmbt
and check all the entries, and then it will load the incore tree and
check every entry in that tree, possibly for a second time.

Simplify the code and decrease check runtime by separating the two
responsibilities.  The bmbt walk will make sure the incore extent
mappings are loaded, check the shape of the bmap btree (via xchk_btree)
and check that every bmbt record has a corresponding incore extent map;
and the incore extent map walk takes all the responsibility for checking
the mapping records and cross referencing them with other AG metadata.

This enables us to clean up some messy parameter handling and reduce
redundant code.  Rename a few functions to make the split of
responsibilities clearer.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/scrub/bmap.c