From: Jan Blunck <jblunck@suse.de>
To: viro@ZenIV.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
vaurora@redhat.com, hch@lst.de, miklos@szeredi.hu
Subject: [PATCH] VFS: BUG() if somebody tries to rehash an already hashed dentry
Date: Wed, 17 Jun 2009 22:45:05 +0200 [thread overview]
Message-ID: <1245271510-31542-2-git-send-email-jblunck@suse.de> (raw)
In-Reply-To: <1245271510-31542-1-git-send-email-jblunck@suse.de>
Break early when somebody tries to rehash an already hashed dentry.
Otherwise this leads to interesting corruptions in the dcache hash table
later on.
Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Valerie Aurora (Henson) <vaurora@redhat.com>
---
fs/dcache.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fs/dcache.c b/fs/dcache.c
index 75659a6..191c488 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1550,6 +1550,7 @@ void d_rehash(struct dentry * entry)
{
spin_lock(&dcache_lock);
spin_lock(&entry->d_lock);
+ BUG_ON(!d_unhashed(entry));
_d_rehash(entry);
spin_unlock(&entry->d_lock);
spin_unlock(&dcache_lock);
--
1.6.0.2
next prev parent reply other threads:[~2009-06-17 20:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-17 20:45 [PATCH] Preparation work for VFS based union mounts Jan Blunck
2009-06-17 20:45 ` Jan Blunck [this message]
2009-06-17 20:45 ` [PATCH] VFS: propagate mnt_flags into do_loopback Jan Blunck
2009-06-17 20:45 ` [PATCH] VFS: Make lookup_hash() return a struct path Jan Blunck
2009-06-18 11:19 ` James Morris
2009-06-17 20:45 ` [PATCH] VFS: Remove unnecessary micro-optimization in cached_lookup() Jan Blunck
2009-06-17 20:45 ` [PATCH] VFS: Make real_lookup() return a struct path Jan Blunck
2009-06-18 11:21 ` James Morris
2009-06-17 20:45 ` [PATCH] VFS: Introduce dput() variant that maintains a kill-list Jan Blunck
2009-06-18 11:30 ` James Morris
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=1245271510-31542-2-git-send-email-jblunck@suse.de \
--to=jblunck@suse.de \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=vaurora@redhat.com \
--cc=viro@ZenIV.linux.org.uk \
/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).