From mboxrd@z Thu Jan 1 00:00:00 1970 From: Valerie Aurora Subject: [PATCH 01/41] VFS: BUG() if somebody tries to rehash an already hashed dentry Date: Wed, 21 Oct 2009 12:18:59 -0700 Message-ID: <1256152779-10054-2-git-send-email-vaurora@redhat.com> References: <1256152779-10054-1-git-send-email-vaurora@redhat.com> Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Blunck To: Jan Blunck , Alexander Viro , Christoph Hellwig , Andy Whitcroft , Scott James Remnant In-Reply-To: <1256152779-10054-1-git-send-email-vaurora@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org From: Jan Blunck 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 Signed-off-by: Valerie Aurora --- fs/dcache.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index 9e5cd3c..38bf982 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.3.3