Skip to content

Commit

Permalink
[PATCH] fs: add a sanity check in d_free
Browse files Browse the repository at this point in the history
Hi Al,

remember that debug session we did at KS? You suggested this patch back
then....

From 7751eaf30474b8cbfaea64795805a17eab05ac53 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Tue, 16 Sep 2008 16:51:17 -0700
Subject: [PATCH] fs: add a sanity check in d_free

we're seeing some corruption in the dentry->d_alias list that
appears like a free of an entry still on the list; this patch
adds a WARN_ON() to catch this scenario, as suggested by Al Viro

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
  • Loading branch information
Arjan van de Ven authored and Al Viro committed Oct 23, 2008
1 parent 08b9fe6 commit fd217f4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct dentry_stat_t dentry_stat = {

static void __d_free(struct dentry *dentry)
{
WARN_ON(!list_empty(&dentry->d_alias));
if (dname_external(dentry))
kfree(dentry->d_name.name);
kmem_cache_free(dentry_cache, dentry);
Expand Down

0 comments on commit fd217f4

Please sign in to comment.