milos-linux/fs/ceph
Linus Torvalds 292a2bcd17 Fixing livelocks in shrink_dcache_tree()
If shrink_dcache_tree() finds a dentry in the middle of being killed
 by another thread, it has to wait until the victim finishes dying,
 gets detached from the tree and ceases to pin its parent.
 
 The way we used to deal with that amounted to busy-wait; unfortunately,
 it's not just inefficient but can lead to reliably reproducible hard
 livelocks.
 
 Solved by having shrink_dentry_tree() attach a completion to such dentry,
 with dentry_unlist() calling complete() on all objects attached to it.
 With a bit of care it can be done without growing struct dentry or adding
 overhead in normal case.
 
 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQqUNBr3gm4hGXdBJlZ7Krx/gZQ6wUCaec/ugAKCRBZ7Krx/gZQ
 6y77AP9l/IL36Ic45p45FCTirA6LFyIvZ5Gixm3Xk64Pi1Y3nAEAqQ5UOVnJc907
 RyrCpcI6vnO8a67MptchOxK9d1bIxQw=
 =A8JL
 -----END PGP SIGNATURE-----

Merge tag 'pull-dcache-busy-wait' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull dcache busy loop updates from Al Viro:
 "Fix livelocks in shrink_dcache_tree()

  If shrink_dcache_tree() finds a dentry in the middle of being killed
  by another thread, it has to wait until the victim finishes dying,
  gets detached from the tree and ceases to pin its parent.

  The way we used to deal with that amounted to busy-wait;
  unfortunately, it's not just inefficient but can lead to reliably
  reproducible hard livelocks.

  Solved by having shrink_dentry_tree() attach a completion to such
  dentry, with dentry_unlist() calling complete() on all objects
  attached to it. With a bit of care it can be done without growing
  struct dentry or adding overhead in normal case"

* tag 'pull-dcache-busy-wait' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  get rid of busy-waiting in shrink_dcache_tree()
  dcache.c: more idiomatic "positives are not allowed" sanity checks
  struct dentry: make ->d_u anonymous
  for_each_alias(): helper macro for iterating through dentries of given inode
2026-04-21 07:30:44 -07:00
..
acl.c posix_acl: make posix_acl_to_xattr() alloc the buffer 2026-01-16 10:51:12 +01:00
addr.c folio_batch: rename pagevec.h to folio_batch.h 2026-04-05 13:53:07 -07:00
cache.c ceph: use the new ->i_state accessors 2025-10-20 20:22:27 +02:00
cache.h
caps.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ceph_frag.c
crypto.c treewide: change inode->i_ino from unsigned long to u64 2026-03-06 14:31:28 +01:00
crypto.h ceph: replace local base64 helpers with lib/base64 2025-11-20 14:03:44 -08:00
debugfs.c ceph: add a bunch of missing ceph_path_info initializers 2026-03-09 12:34:40 +01:00
dir.c ceph: add a bunch of missing ceph_path_info initializers 2026-03-09 12:34:40 +01:00
export.c
file.c ceph: add a bunch of missing ceph_path_info initializers 2026-03-09 12:34:40 +01:00
inode.c ceph: add a bunch of missing ceph_path_info initializers 2026-03-09 12:34:40 +01:00
io.c ceph: fix potential race condition on operations with CEPH_I_ODIRECT flag 2025-10-08 23:30:46 +02:00
io.h ceph: make ceph_start_io_*() killable 2025-10-08 23:30:46 +02:00
ioctl.c ceph: fix potential race condition in ceph_ioctl_lazyio() 2025-10-08 23:30:46 +02:00
ioctl.h
Kconfig ceph: stop selecting CRC32, CRYPTO, and CRYPTO_AES 2025-12-10 11:50:54 +01:00
locks.c ceph: add checking of wait_for_completion_killable() return value 2025-10-08 23:30:46 +02:00
Makefile
mds_client.c struct dentry: make ->d_u anonymous 2026-04-02 03:47:31 -04:00
mds_client.h ceph: fix race condition validating r_parent before applying state 2025-09-09 12:57:02 +02:00
mdsmap.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
mdsmap.h ceph: fix NULL pointer dereference in ceph_mds_auth_match() 2026-02-04 22:00:42 +01:00
metric.c
metric.h
quota.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
snap.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
strings.c
super.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
super.h ceph: fix NULL pointer dereference in ceph_mds_auth_match() 2026-02-04 22:00:42 +01:00
util.c
xattr.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00