aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_bmap.c
diff options
context:
space:
mode:
authorGravatar Darrick J. Wong <djwong@kernel.org> 2024-02-22 12:34:13 -0800
committerGravatar Darrick J. Wong <djwong@kernel.org> 2024-02-22 12:34:13 -0800
commitc0afba9a8363f17d4efed22a8764df33389aebe8 (patch)
tree37fca1cf3b145bbd55f261a7c5bca259e2ca8d53 /fs/xfs/libxfs/xfs_bmap.c
parentxfs: drop XFS_BTREE_CRC_BLOCKS (diff)
downloadlinux-c0afba9a8363f17d4efed22a8764df33389aebe8.tar.gz
linux-c0afba9a8363f17d4efed22a8764df33389aebe8.tar.bz2
linux-c0afba9a8363f17d4efed22a8764df33389aebe8.zip
xfs: fix imprecise logic in xchk_btree_check_block_owner
A reviewer was confused by the init_sa logic in this function. Upon checking the logic, I discovered that the code is imprecise. What we want to do here is check that there is an ownership record in the rmap btree for the AG that contains a btree block. For an inode-rooted btree (e.g. the bmbt) the per-AG btree cursors have not been initialized because inode btrees can span multiple AGs. Therefore, we must initialize the per-AG btree cursors in sc->sa before proceeding. That is what init_sa controls, and hence the logic should be gated on XFS_BTREE_ROOT_IN_INODE, not XFS_BTREE_LONG_PTRS. In practice, ROOT_IN_INODE and LONG_PTRS are coincident so this hasn't mattered. However, we're about to refactor both of those flags into separate btree_ops fields so we want this the logic to make sense afterwards. Fixes: 858333dcf021a ("xfs: check btree block ownership with bnobt/rmapbt when scrubbing btree") Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.c')
0 files changed, 0 insertions, 0 deletions