From: Arjan van de Ven Date: Tue, 21 Oct 2008 13:47:33 +0000 (-0700) Subject: [PATCH] fs: add a sanity check in d_free X-Git-Tag: v2.6.28-rc1~24^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=fd217f4d70172c526478f2bc76859e909fdfa674;p=linux-2.6-omap-h63xx.git [PATCH] fs: add a sanity check in d_free 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 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 --- diff --git a/fs/dcache.c b/fs/dcache.c index 12eac838558..a1d86c7f3e6 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)) kfree(dentry->d_name.name); kmem_cache_free(dentry_cache, dentry);