mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] igrab() should check for I_CLEAR
@ 2006-12-19  9:57 Jan Blunck
  0 siblings, 0 replies; only message in thread
From: Jan Blunck @ 2006-12-19  9:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux-Kernel Mailinglist, Vandana Rungta

When igrab() is calling __iget() on an inode it should check if clear_inode()
has been called on the inode already. Otherwise there is a race window between
clear_inode() and destroy_inode() where igrab() calls __iget() which leads to
already free inodes on the inode lists.

Signed-off-by: Vandana Rungta <vandana@novell.com>
Signed-off-by: Jan Blunck <jblunck@suse.de>
---
 fs/inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/fs/inode.c
===================================================================
--- linux-2.6.orig/fs/inode.c
+++ linux-2.6/fs/inode.c
@@ -709,7 +709,7 @@ EXPORT_SYMBOL(iunique);
 struct inode *igrab(struct inode *inode)
 {
 	spin_lock(&inode_lock);
-	if (!(inode->i_state & (I_FREEING|I_WILL_FREE)))
+	if (!(inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE)))
 		__iget(inode);
 	else
 		/*

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-12-19  9:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-19  9:57 [PATCH] igrab() should check for I_CLEAR Jan Blunck

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

all inboxes | Powered by JetHome®