]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: fix sizing of the incore rt space usage map calculation
authorDarrick J. Wong <djwong@kernel.org>
Wed, 18 May 2022 02:48:12 +0000 (22:48 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 18 May 2022 02:48:12 +0000 (22:48 -0400)
commit3a7f7109a817e4084bd9eee1f311b579caaf2e77
treeed8bdda55094c9bdcac27f79036c5cf7f5c267de
parent462c38a515277c80218557a11d3b248387a6264b
xfs_repair: fix sizing of the incore rt space usage map calculation

If someone creates a realtime volume exactly *one* extent in length, the
sizing calculation for the incore rt space usage bitmap will be zero
because the integer division here rounds down.  Use howmany() to round
up.  Note that there can't be that many single-extent rt volumes since
repair will corrupt them into zero-extent rt volumes, and we haven't
gotten any reports.

Found by running xfs/530 after fixing xfs_repair to check the rt bitmap.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/incore.c