Skip to contentSkip to conversation

fs: add a sanity check in d_free

PATCH New Arjan van de Ven 1 participant 1 message Sep 16, 2008 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: add a sanity check in d_free

Quoted 2 lines

From 4ab03e637c357ea70c737cd401732a4d80375173 Mon Sep 17 00:00:00 2001

From: Arjan van de Ven <[email protected]>
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

---
 fs/dcache.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
fs/dcache.c +1 -0
index 80e9395..4c39a59 100644
@@ -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); 
Signature · 7 lines
1.5.5.1


-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org