]> www.infradead.org Git - users/dwmw2/linux.git/commit
xfs: adjust min_block usage in xfs_verify_agbno
authorDarrick J. Wong <djwong@kernel.org>
Mon, 4 Nov 2024 04:19:34 +0000 (20:19 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 5 Nov 2024 21:38:44 +0000 (13:38 -0800)
commitceaa0bd773e2d6d5726d6535f605ecd6b26d2fcc
tree8cf1d1e9edefd7d51ce6c85f584d95177150f797
parent7195f240c6578caa9e24202a26aa612a7e8cba26
xfs: adjust min_block usage in xfs_verify_agbno

There's some weird logic in xfs_verify_agbno -- min_block ought to be
the first agblock number in the AG that can be used by non-static
metadata.  However, we initialize it to the last agblock of the static
metadata, which works due to the <= check, even though this isn't
technically correct.

Change the check to < and set min_block to the next agblock past the
static metadata.  This hasn't been an issue up to now, but we're going
to move these things into the generic group struct, and this will cause
problems with rtgroups, where min_block can be zero for an rtgroup that
doesn't have a rt superblock.

Note that there's no user-visible impact with the old logic, so this
isn't a bug fix.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_ag.c
fs/xfs/libxfs/xfs_ag.h