From: Niels de Vos <ndevos@redhat.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: fuse-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
Niels de Vos <ndevos@redhat.com>
Subject: [PATCH] fuse: fix occasional dentry leak when readdirplus is used
Date: Mon, 15 Jul 2013 14:59:20 +0200 [thread overview]
Message-ID: <1373893160-30601-1-git-send-email-ndevos@redhat.com> (raw)
In case d_lookup() returns a dentry with d_inode == NULL, the dentry is
not returned with dput(). This results in triggering a BUG() in
shrink_dcache_for_umount_subtree():
BUG: Dentry ...{i=0,n=...} still in use (1) [unmount of fuse fuse]
Reported-by: Justin Clift <jclift@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
--
Reproducing the BUG() on kernels with fuse that support READDIRPLUS can
be done with the GlusterFS tests:
- http://www.gluster.org/community/documentation/index.php/Using_the_Gluster_Test_Framework
After some stressing of the VFS and fuse mountpoints, bug-860663.t will
hit the BUG(). It does not happen on running this test stand-alone.
---
fs/fuse/dir.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 0eda527..da67a15 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1246,7 +1246,9 @@ static int fuse_direntplus_link(struct file *file,
if (err)
goto out;
dput(dentry);
- dentry = NULL;
+ } else if (dentry) {
+ /* this dentry does not have a d_inode, just drop it */
+ dput(dentry);
}
dentry = d_alloc(parent, &name);
--
1.7.1
next reply other threads:[~2013-07-15 13:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 12:59 Niels de Vos [this message]
2013-07-15 20:08 ` [fuse-devel] [PATCH] fuse: fix occasional dentry leak when readdirplus is used Brian Foster
2013-07-16 10:39 ` Niels de Vos
2013-07-16 13:15 ` Brian Foster
2013-07-16 16:14 ` Miklos Szeredi
2013-07-16 17:43 ` Brian Foster
2013-07-17 11:20 ` Niels de Vos
2013-07-17 13:04 ` Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1373893160-30601-1-git-send-email-ndevos@redhat.com \
--to=ndevos@redhat.com \
--cc=fuse-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).