]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: fix stupid argument error in verify_inode_chunk
authorDarrick J. Wong <djwong@kernel.org>
Fri, 21 Mar 2025 16:32:17 +0000 (09:32 -0700)
committerAndrey Albershteyn <aalbersh@kernel.org>
Mon, 31 Mar 2025 09:45:45 +0000 (11:45 +0200)
commit06adb3cb38beb304b7b1f002de95e59cfa9098fb
treee9bd8d7631586a321c3ac89ecc67dd35f4b7db13
parentbbd8ba73e64b43b29e96b813173aafd6da4ab1fc
xfs_repair: fix stupid argument error in verify_inode_chunk

An arm64 VM running fstests with 64k fsblock size blew up the test
filesystem when the OOM killer whacked xfs_repair as it was rebuilding a
sample filesystem.  A subsequent attempt by fstests to repair the
filesystem printed stuff like this:

inode rec for ino 39144576 (1/5590144) overlaps existing rec (start 1/5590144)
inode rec for ino 39144640 (1/5590208) overlaps existing rec (start 1/5590208)

followed by a lot of errors such as:

cannot read agbno (1/5590208), disk block 734257664
xfs_repair: error - read only 0 of 65536 bytes

Here we're feeding per-AG inode numbers into a block reading function as
if it were a per-AG block number.  This is wrong by a factor of 128x so
we read past the end of the filesystem.  Worse yet, the buffer cache
fills up memory and thus the second repair process is also OOM killed.
The filesystem is not fixed.

Cc: linux-xfs@vger.kernel.org # v3.1.8
Fixes: 0553a94f522c17 ("repair: kill check_inode_block")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
repair/dino_chunks.c