diff options
author | Arjan van de Ven <arjan@infradead.org> | 2008-10-21 09:47:33 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-10-23 05:17:12 -0400 |
commit | fd217f4d70172c526478f2bc76859e909fdfa674 (patch) | |
tree | df707d185b3009ada981c17211a6e02097e8fc7b | |
parent | 08b9fe6b12d32324f311c46b88102b6b9067d434 (diff) |
[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 <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>
-rw-r--r-- | fs/dcache.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 12eac838558a..a1d86c7f3e66 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -69,6 +69,7 @@ struct dentry_stat_t dentry_stat = { | |||
69 | 69 | ||
70 | static void __d_free(struct dentry *dentry) | 70 | static void __d_free(struct dentry *dentry) |
71 | { | 71 | { |
72 | WARN_ON(!list_empty(&dentry->d_alias)); | ||
72 | if (dname_external(dentry)) | 73 | if (dname_external(dentry)) |
73 | kfree(dentry->d_name.name); | 74 | kfree(dentry->d_name.name); |
74 | kmem_cache_free(dentry_cache, dentry); | 75 | kmem_cache_free(dentry_cache, dentry); |