]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: track the number of blocks in each buftarg
authorChristoph Hellwig <hch@lst.de>
Fri, 19 Sep 2025 13:12:08 +0000 (06:12 -0700)
committerCarlos Maiolino <cem@kernel.org>
Mon, 22 Sep 2025 10:55:20 +0000 (12:55 +0200)
commit42852fe57c6d2a0abb10429841cb1226b7186b7a
tree8c4dae57b304de70e9e1a5b5ed2c0ab6aed235f3
parent3c54e6027f14c4f54be5508af748f6cc2fd72f89
xfs: track the number of blocks in each buftarg

Add a bt_nr_sectors to track the number of sector in each buftarg, and
replace the check that hard codes sb_dblock in xfs_buf_map_verify with
this new value so that it is correct for non-ddev buftargs.  The
RT buftarg only has a superblock in the first block, so it is unlikely
to trigger this, or are we likely to ever have enough blocks in the
in-memory buftargs, but we might as well get the check right.

Fixes: 10616b806d1d ("xfs: fix _xfs_buf_find oops on blocks beyond the filesystem end")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_buf.c
fs/xfs/xfs_buf.h
fs/xfs/xfs_buf_item_recover.c
fs/xfs/xfs_super.c
fs/xfs/xfs_trans.c