xfs: check rt summary 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)
commit04f0c3269b41f28c041980a30514850453ded251
treeebbb7260b3afcca050a811037c4654fdc1a290b3
parent41991cf298919de211c63251d72266aff70ecad0
xfs: check rt summary file geometry more thoroughly

I forgot that the xfs_mount tracks the size and number of levels in the
realtime summary file, and that the rt summary file can have more blocks
mapped to the data fork than m_rsumsize implies if growfsrt fails.

So.  Add to the rtsummary scrubber an explicit check that all the
summary geometry values are correct, then adjust the rtsummary i_size
checks to allow for the growfsrt failure case.  Finally, flag post-eof
blocks in the summary file.

While we're at it, split the extent map checking so that we only call
xfs_bmapi_read once per extent instead of once per rtsummary block.

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