summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Blunck <jblunck@suse.de>2007-02-10 01:44:59 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 10:51:26 -0800
commit4a3b0a490d49ada8bbf3f426be1a0ace4dcd0a55 (patch)
tree3816f425c64a7b551894f098b6f5b5f238339ed0
parent068135e63518314d4efd711142f674ad0841599e (diff)
downloadlinux-4a3b0a490d49ada8bbf3f426be1a0ace4dcd0a55.tar.gz
linux-4a3b0a490d49ada8bbf3f426be1a0ace4dcd0a55.tar.bz2
linux-4a3b0a490d49ada8bbf3f426be1a0ace4dcd0a55.zip
[PATCH] igrab() should check for I_CLEAR
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> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 6cacdab25e0a..062c5f9b6a69 100644
--- a/fs/inode.c
+++ b/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
/*