From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH] GFS2: call d_add for a NULL entry when an inode lookup fails
Date: Tue, 9 Sep 2014 14:24:47 -0400 (EDT) [thread overview]
Message-ID: <1933007886.19442570.1410287087663.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1943342351.19440571.1410286794649.JavaMail.zimbra@redhat.com>
Hi,
This patch was originally written by Benjamin Coddington (credit where
credit is due).
GFS2's inode lookup wasn't hashing the dentry when an inode wasn't found.
That caused the dentry/inode to get an early cleanup attempt through
dentry_kill when a create op cleaned up the filehandle. That caused the
entry to hang around until unmount time, which means if the file was
created then deleted, its space and inode were not reclaimed until then.
This problem was introduced by gfs2's new atomic open code. The patch
simply adds the d_add (as other file systems do) when inode lookups fail.
Regards,
Bob Peterson
Red Hat File Systems
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index e62e594..9317ddc 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -840,8 +840,10 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry,
int error;
inode = gfs2_lookupi(dir, &dentry->d_name, 0);
- if (!inode)
+ if (inode == NULL) {
+ d_add(dentry, NULL);
return NULL;
+ }
if (IS_ERR(inode))
return ERR_CAST(inode);
parent reply other threads:[~2014-09-09 18:24 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1943342351.19440571.1410286794649.JavaMail.zimbra@redhat.com>]
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=1933007886.19442570.1410287087663.JavaMail.zimbra@redhat.com \
--to=rpeterso@redhat.com \
/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).