diff --git a/0013-xfs_repair-fix-stupid-argument-error-in-verify_inode.patch b/0013-xfs_repair-fix-stupid-argument-error-in-verify_inode.patch new file mode 100644 index 0000000000000000000000000000000000000000..e857cb1342fee4c45f0ea661ab9b8e66c568f555 --- /dev/null +++ b/0013-xfs_repair-fix-stupid-argument-error-in-verify_inode.patch @@ -0,0 +1,48 @@ +From 06adb3cb38beb304b7b1f002de95e59cfa9098fb Mon Sep 17 00:00:00 2001 +From: "Darrick J. Wong" +Date: Fri, 21 Mar 2025 09:32:17 -0700 +Subject: 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 +Reviewed-by: Christoph Hellwig +--- + repair/dino_chunks.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/repair/dino_chunks.c b/repair/dino_chunks.c +index 1717568..6d30e5d 100644 +--- a/repair/dino_chunks.c ++++ b/repair/dino_chunks.c +@@ -129,7 +129,7 @@ verify_inode_chunk(xfs_mount_t *mp, + 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; + + pthread_mutex_lock(&ag_locks[agno].lock); +-- +2.43.0 + diff --git a/xfsprogs.spec b/xfsprogs.spec index f4739f8c049210cd248c942c41d9122bb6d45d9d..e65fd16ccae6d3346fc57f1284117c6154497b3d 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -1,6 +1,6 @@ Name: xfsprogs Version: 6.6.0 -Release: 13 +Release: 14 Summary: Administration and debugging tools for the XFS file system License: GPL-1.0-or-later AND LGPL-2.1-or-later URL: https://xfs.wiki.kernel.org @@ -31,6 +31,7 @@ Patch9: 0009-xfs_repair-don-t-crash-in-get_inode_parent.patch Patch10: 0010-misc-fix-reversed-calloc-arguments.patch Patch11: 0011-mkfs-fix-the-issue-of-maxpct-set-to-0-not-taking-eff.patch Patch12: 0012-xfs_repair-don-t-leak-the-rootdir-inode-when-orphana.patch +Patch13: 0013-xfs_repair-fix-stupid-argument-error-in-verify_inode.patch %description xfsprogs are the userspace utilities that manage XFS filesystems. @@ -103,6 +104,9 @@ rm -rf %{buildroot}%{_datadir}/doc/xfsprogs/ %exclude %{_mandir}/man8/xfs_scrub* %changelog +* Wed Nov 12 2025 liuh - 6.6.0-14 +- xfs_repair: fix stupid argument error in verify_inode_chunk + * Mon Nov 3 2025 liuh - 6.6.0-13 - xfs_repair: don't leak the rootdir inode when orphanage already exists