[PATCH] fs: add a sanity check in d_free

From: Arjan van de Ven
Date: Tue Sep 16 2008 - 19:51:17 EST

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@xxxxxxxxxxxxxxx>
fs/dcache.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 80e9395..4c39a59 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -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))
kmem_cache_free(dentry_cache, dentry);

Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/