Files
linux/fs/xfs/scrub
Darrick J. Wong f477af0cfa xfs: fix locking in xchk_nlinks_collect_dir
On a filesystem with parent pointers, xchk_nlinks_collect_dir walks both
the directory entries (data fork) and the parent pointers (attr fork) to
determine the correct link count.  Unfortunately I forgot to update the
lock mode logic to handle the case of a directory whose attr fork is in
btree format and has not yet been loaded *and* whose data fork doesn't
need loading.

This leads to a bunch of assertions from xfs/286 in xfs_iread_extents
because we only took ILOCK_SHARED, not ILOCK_EXCL.  You'd need the rare
happenstance of a directory with a large number of non-pptr extended
attributes set and enough memory pressure to cause the directory to be
evicted and partially reloaded from disk.

I /think/ this only started in 6.18-rc1 because I've started seeing OOM
errors with the maple tree slab using 70% of memory, and this didn't
happen in 6.17.  Yay dynamic systems!

Cc: stable@vger.kernel.org # v6.10
Fixes: 77ede5f44b ("xfs: walk directory parent pointers to determine backref count")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
2025-10-22 10:04:39 +02:00
..
2024-04-15 14:58:53 -07:00
2023-05-26 13:52:19 -07:00
2024-11-05 13:38:34 -08:00
2024-11-05 13:38:34 -08:00
2024-11-05 13:38:34 -08:00
2025-03-10 14:29:44 +01:00
2025-03-03 08:16:45 -07:00
2023-12-15 10:03:40 -08:00
2024-11-05 13:38:34 -08:00
2023-12-15 10:03:45 -08:00
2024-04-26 11:21:46 +05:30
2024-04-23 07:47:02 -07:00
2024-12-23 13:06:17 -08:00
2025-01-13 14:57:08 +01:00
2024-12-23 13:06:14 -08:00
2024-04-15 14:58:58 -07:00
2024-04-15 14:58:53 -07:00
2024-04-15 14:58:55 -07:00
2024-04-15 14:58:53 -07:00
2024-04-23 16:55:18 -07:00