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>
if (igeo->ialloc_blks == 1) {
if (agbno > max_agbno)
return 0;
- if (check_aginode_block(mp, agno, agino) == 0)
+ if (check_aginode_block(mp, agno, agbno) == 0)
return 0;
lock_ag(agno);