public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* missed inode->i_hash cleanup in prune_icache()
@ 2002-12-27 10:23 Nikita Danilov
  2002-12-27 11:13 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Nikita Danilov @ 2002-12-27 10:23 UTC (permalink / raw)
  To: Linus Torvalds, Linux Kernel Mailing List

Hello,

fs/inode.c:prune_icache() does list_del(&inode->i_hash), and then calls
destroy_inode(). Inode is returned to the slab with ->i_hash still
containing dangling pointers. Probably this wasn't observed so far,
because prune_icache() is called during memory pressure and slab page
where inode is returned back into, is almost immediately released.

2.4 explicitly calls INIT_LIST_HEAD(&inode->i_hash) in prune_icache().

Following patch re-initializes ->i_hash.

Nikita.
===== fs/inode.c 1.84 vs edited =====
--- 1.84/fs/inode.c	Mon Dec 16 09:38:48 2002
+++ edited/fs/inode.c	Wed Dec 25 16:19:10 2002
@@ -248,7 +248,7 @@
 		struct inode *inode;
 
 		inode = list_entry(head->next, struct inode, i_list);
-		list_del(&inode->i_list);
+		list_del_init(&inode->i_list);
 
 		if (inode->i_data.nrpages)
 			truncate_inode_pages(&inode->i_data, 0);


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-27 11:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-27 10:23 missed inode->i_hash cleanup in prune_icache() Nikita Danilov
2002-12-27 11:13 ` Andrew Morton
2002-12-27 11:41   ` Nikita Danilov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox