xfs: check rt bitmap file geometry more thoroughly
authorDarrick J. Wong <djwong@kernel.org>
Fri, 15 Dec 2023 18:03:41 +0000 (10:03 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 15 Dec 2023 18:03:41 +0000 (10:03 -0800)
commit41991cf298919de211c63251d72266aff70ecad0
tree53ca8f9316ee3c27375bff35e08863af241fbec1
parentdbbdbd0086320a026903ca34efedb6abf55230ed
xfs: check rt bitmap file geometry more thoroughly

I forgot that the superblock tracks the number of blocks that are in the
realtime bitmap, and that the rt bitmap file can have more blocks mapped
to the data fork than sb_rbmblocks if growfsrt fails.

So.  Add to the rtbitmap scrubber an explicit check that sb_rextents and
sb_rbmblocks are correct, then adjust the rtbitmap i_size checks to
allow for the growfsrt failure case.  Finally, flag post-eof blocks in
the rtbitmap.

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