public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cachefiles: Fix excess dput() after end_removing()
@ 2026-03-24 22:35 David Howells
  2026-03-24 22:50 ` David Howells
  2026-03-26 10:15 ` [PATCH v2] " David Howells
  0 siblings, 2 replies; 6+ messages in thread
From: David Howells @ 2026-03-24 22:35 UTC (permalink / raw)
  To: NeilBrown
  Cc: dhowells, Marc Dionne, Paulo Alcantara, Christian Brauner, netfs,
	linux-afs, linux-fsdevel, linux-kernel

When cachefiles_cull() calls cachefiles_bury_object(), the latter eats the
former's ref on the victim dentry that it obtained from
cachefiles_lookup_for_cull().  However, commit 7bb1eb45e43c left the dput
of the victim in place, resulting in occasional:

  WARNING: fs/dcache.c:829 at dput.part.0+0xf5/0x110, CPU#7: cachefilesd/11831
  cachefiles_cull+0x8c/0xe0 [cachefiles]
  cachefiles_daemon_cull+0xcd/0x120 [cachefiles]
  cachefiles_daemon_write+0x14e/0x1d0 [cachefiles]
  vfs_write+0xc3/0x480
  ...

reports.

Fix this by removing the dput().

Fixes: 7bb1eb45e43c ("VFS: introduce start_removing_dentry()")
Reported-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: NeilBrown <neil@brown.name>
cc: Paulo Alcantara <pc@manguebit.org>
cc: netfs@lists.linux.dev
cc: linux-afs@lists.infradead.org
cc: linux-fsdevel@vger.kernel.org
---
 fs/cachefiles/namei.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c
index bdac2f33edf3..e2023e78e4df 100644
--- a/fs/cachefiles/namei.c
+++ b/fs/cachefiles/namei.c
@@ -795,7 +795,6 @@ int cachefiles_cull(struct cachefiles_cache *cache, struct dentry *dir,
 
 	ret = cachefiles_bury_object(cache, NULL, dir, victim,
 				     FSCACHE_OBJECT_WAS_CULLED);
-	dput(victim);
 	if (ret < 0)
 		goto error;
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-26 10:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24 22:35 [PATCH] cachefiles: Fix excess dput() after end_removing() David Howells
2026-03-24 22:50 ` David Howells
2026-03-25 12:57   ` Marc Dionne
2026-03-26  7:51     ` David Howells
2026-03-26  9:07       ` NeilBrown
2026-03-26 10:15 ` [PATCH v2] " David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox