linux/fs/xfs
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
..
libxfs xfs: improve default maximum number of open zones 2025-09-18 17:32:39 +02:00
scrub xfs: fix locking in xchk_nlinks_collect_dir 2025-10-22 10:04:39 +02:00
Kconfig xfs: XFS_ONLINE_SCRUB_STATS should depend on DEBUG_FS 2025-10-21 09:52:59 +02:00
Makefile
xfs.h
xfs_acl.c
xfs_acl.h
xfs_aops.c xfs: reject swapon for inodes on a zoned file system earlier 2025-08-19 14:38:39 +02:00
xfs_aops.h
xfs_attr_inactive.c
xfs_attr_item.c xfs: remove the expr argument to XFS_TEST_ERROR 2025-09-18 17:32:02 +02:00
xfs_attr_item.h xfs: don't use a xfs_log_iovec for attr_item names and values 2025-07-24 17:30:15 +02:00
xfs_attr_list.c
xfs_bio_io.c xfs: simplify xfs_rw_bdev 2025-05-07 07:31:07 -06:00
xfs_bmap_item.c xfs: don't use a xfs_log_iovec for ri_buf in log recovery 2025-07-24 17:30:15 +02:00
xfs_bmap_item.h xfs: add helpers to compute log item overhead 2025-05-07 14:25:30 -07:00
xfs_bmap_util.c
xfs_bmap_util.h
xfs_buf.c xfs: don't set bt_nr_sectors to a negative number 2025-10-22 10:04:39 +02:00
xfs_buf.h xfs: don't set bt_nr_sectors to a negative number 2025-10-22 10:04:39 +02:00
xfs_buf_item.c xfs: don't use a xfs_log_iovec for ri_buf in log recovery 2025-07-24 17:30:15 +02:00
xfs_buf_item.h xfs: don't use a xfs_log_iovec for ri_buf in log recovery 2025-07-24 17:30:15 +02:00
xfs_buf_item_recover.c xfs: track the number of blocks in each buftarg 2025-09-22 12:55:20 +02:00
xfs_buf_mem.c xfs: compute buffer address correctly in xmbuf_map_backing_mem 2025-04-14 11:22:52 +02:00
xfs_buf_mem.h
xfs_dahash_test.c
xfs_dahash_test.h
xfs_dir2_readdir.c
xfs_discard.c xfs: return the allocated transaction from xfs_trans_alloc_empty 2025-07-24 17:30:13 +02:00
xfs_discard.h
xfs_dquot.c xfs: avoid dquot buffer pin deadlock 2025-06-27 14:14:37 +02:00
xfs_dquot.h
xfs_dquot_item.c
xfs_dquot_item.h
xfs_dquot_item_recover.c xfs: don't use a xfs_log_iovec for ri_buf in log recovery 2025-07-24 17:30:15 +02:00
xfs_drain.c
xfs_drain.h
xfs_error.c xfs: constify xfs_errortag_random_default 2025-09-19 18:03:08 +02:00
xfs_error.h xfs: remove pointless externs in xfs_error.h 2025-09-18 17:32:02 +02:00
xfs_exchmaps_item.c xfs: don't use a xfs_log_iovec for ri_buf in log recovery 2025-07-24 17:30:15 +02:00
xfs_exchmaps_item.h
xfs_exchrange.c
xfs_exchrange.h
xfs_export.c
xfs_export.h
xfs_extent_busy.c
xfs_extent_busy.h xfs: don't allocate the xfs_extent_busy structure for zoned RTGs 2025-07-18 17:42:31 +02:00
xfs_extfree_item.c xfs: remove the xfs_efi_log_format_64_t typedef 2025-09-16 12:25:05 +02:00
xfs_extfree_item.h xfs: remove the xfs_efd_log_format_t typedef 2025-09-16 12:25:05 +02:00
xfs_file.c xfs: rework datasync tracking and execution 2025-09-23 15:12:43 +02:00
xfs_file.h
xfs_filestream.c xfs: free the item in xfs_mru_cache_insert on failure 2025-05-14 19:00:12 +02:00
xfs_filestream.h
xfs_fsmap.c xfs: return the allocated transaction from xfs_trans_alloc_empty 2025-07-24 17:30:13 +02:00
xfs_fsmap.h
xfs_fsops.c
xfs_fsops.h
xfs_globals.c xfs: remove deprecated sysctl knobs 2025-09-05 08:48:23 -07:00
xfs_handle.c
xfs_handle.h
xfs_health.c
xfs_hooks.c
xfs_hooks.h
xfs_icache.c xfs: remove deprecated mount options 2025-09-05 08:48:23 -07:00
xfs_icache.h
xfs_icreate_item.c xfs: don't use a xfs_log_iovec for ri_buf in log recovery 2025-07-24 17:30:15 +02:00
xfs_icreate_item.h
xfs_inode.c xfs: new code for 6.18 2025-09-29 14:35:44 -07:00
xfs_inode.h xfs: disallow atomic writes on DAX 2025-08-11 14:03:44 +02:00
xfs_inode_item.c xfs: rework datasync tracking and execution 2025-09-23 15:12:43 +02:00
xfs_inode_item.h xfs: rework datasync tracking and execution 2025-09-23 15:12:43 +02:00
xfs_inode_item_recover.c xfs: don't use a xfs_log_iovec for ri_buf in log recovery 2025-07-24 17:30:15 +02:00
xfs_ioctl.c xfs: implement XFS_IOC_DIOINFO in terms of vfs_getattr 2025-08-28 14:20:03 +02:00
xfs_ioctl.h tree-wide: s/struct fileattr/struct file_kattr/g 2025-07-04 16:14:39 +02:00
xfs_ioctl32.c
xfs_ioctl32.h
xfs_iomap.c xfs: rework datasync tracking and execution 2025-09-23 15:12:43 +02:00
xfs_iomap.h iomap: replace iomap_folio_ops with iomap_write_ops 2025-07-14 10:51:33 +02:00
xfs_iops.c xfs: kconfig and feature changes for 2025 LTS [6.18 v2 2/2] 2025-09-05 20:27:25 +02:00
xfs_iops.h xfs: refine atomic write size check in xfs_file_write_iter() 2025-05-07 14:25:31 -07:00
xfs_itable.c xfs: remove XFS_IBULK_SAME_AG 2025-08-11 14:03:31 +02:00
xfs_itable.h xfs: remove XFS_IBULK_SAME_AG 2025-08-11 14:03:31 +02:00
xfs_iunlink_item.c
xfs_iunlink_item.h
xfs_iwalk.c xfs: return the allocated transaction from xfs_trans_alloc_empty 2025-07-24 17:30:13 +02:00
xfs_iwalk.h
xfs_linux.h xfs: remove deprecated sysctl knobs 2025-09-05 08:48:23 -07:00
xfs_log.c xfs: new code for 6.18 2025-09-29 14:35:44 -07:00
xfs_log.h xfs: move the XLOG_REG_ constants out of xfs_log_format.h 2025-09-16 14:08:47 +02:00
xfs_log_cil.c xfs: use better names for size members in xfs_log_vec 2025-07-24 17:30:15 +02:00
xfs_log_priv.h xfs: fix log CRC mismatches between i386 and other architectures 2025-09-16 12:27:41 +02:00
xfs_log_recover.c xfs: fix log CRC mismatches between i386 and other architectures 2025-09-16 12:27:41 +02:00
xfs_message.c xfs: remove the EXPERIMENTAL warning for pNFS 2025-05-14 12:42:12 +02:00
xfs_message.h xfs: remove the EXPERIMENTAL warning for pNFS 2025-05-14 12:42:12 +02:00
xfs_mount.c xfs: remove deprecated mount options 2025-09-05 08:48:23 -07:00
xfs_mount.h xfs: cache open zone in inode->i_private 2025-10-21 11:32:50 +02:00
xfs_mru_cache.c fs: WQ_PERCPU added to alloc_workqueue users 2025-09-19 16:15:07 +02:00
xfs_mru_cache.h
xfs_notify_failure.c xfs: use bt_nr_sectors in xfs_dax_translate_range 2025-09-22 12:55:20 +02:00
xfs_notify_failure.h
xfs_pnfs.c xfs: remove the EXPERIMENTAL warning for pNFS 2025-05-14 12:42:12 +02:00
xfs_pnfs.h
xfs_pwork.c
xfs_pwork.h
xfs_qm.c xfs: return the allocated transaction from xfs_trans_alloc_empty 2025-07-24 17:30:13 +02:00
xfs_qm.h
xfs_qm_bhv.c
xfs_qm_syscalls.c
xfs_quota.h
xfs_quotaops.c
xfs_refcount_item.c xfs: don't use a xfs_log_iovec for ri_buf in log recovery 2025-07-24 17:30:15 +02:00
xfs_refcount_item.h xfs: add helpers to compute log item overhead 2025-05-07 14:25:30 -07:00
xfs_reflink.c iomap: replace iomap_folio_ops with iomap_write_ops 2025-07-14 10:51:33 +02:00
xfs_reflink.h xfs: add xfs_calc_atomic_write_unit_max() 2025-05-07 14:25:32 -07:00
xfs_rmap_item.c xfs: don't use a xfs_log_iovec for ri_buf in log recovery 2025-07-24 17:30:15 +02:00
xfs_rmap_item.h xfs: add helpers to compute log item overhead 2025-05-07 14:25:30 -07:00
xfs_rtalloc.c xfs: return the allocated transaction from xfs_trans_alloc_empty 2025-07-24 17:30:13 +02:00
xfs_rtalloc.h
xfs_stats.c
xfs_stats.h
xfs_super.c xfs: loudly complain about defunct mount options 2025-10-22 10:04:39 +02:00
xfs_super.h
xfs_symlink.c
xfs_symlink.h
xfs_sysctl.c xfs: remove deprecated sysctl knobs 2025-09-05 08:48:23 -07:00
xfs_sysctl.h xfs: remove deprecated sysctl knobs 2025-09-05 08:48:23 -07:00
xfs_sysfs.c xfs: add tunable threshold parameter for triggering zone GC 2025-04-14 10:41:33 +02:00
xfs_sysfs.h
xfs_trace.c
xfs_trace.h vfs-6.18-rc1.inode 2025-09-29 09:42:30 -07:00
xfs_trans.c xfs: track the number of blocks in each buftarg 2025-09-22 12:55:20 +02:00
xfs_trans.h xfs: don't use a xfs_log_iovec for ri_buf in log recovery 2025-07-24 17:30:15 +02:00
xfs_trans_ail.c xfs: remove the expr argument to XFS_TEST_ERROR 2025-09-18 17:32:02 +02:00
xfs_trans_buf.c
xfs_trans_dquot.c
xfs_trans_priv.h xfs: remove the leftover xfs_{set,clear}_li_failed infrastructure 2025-04-14 10:24:30 +02:00
xfs_xattr.c xfs: replace strncpy with memcpy in xattr listing 2025-07-08 11:50:09 +02:00
xfs_xattr.h
xfs_zone_alloc.c xfs: cache open zone in inode->i_private 2025-10-21 11:32:50 +02:00
xfs_zone_alloc.h xfs: stop passing an inode to the zone space reservation helpers 2025-07-24 17:30:14 +02:00
xfs_zone_gc.c xfs: avoid busy loops in GCD 2025-10-21 11:32:50 +02:00
xfs_zone_info.c xfs: rename oz_write_pointer to oz_allocated 2025-07-24 17:30:14 +02:00
xfs_zone_priv.h xfs: cache open zone in inode->i_private 2025-10-21 11:32:50 +02:00
xfs_zone_space_resv.c xfs: kick off inodegc when failing to reserve zoned blocks 2025-08-19 14:37:07 +02:00