From: Jan Blunck Date: Sat, 10 Feb 2007 09:44:59 +0000 (-0800) Subject: [PATCH] igrab() should check for I_CLEAR X-Git-Tag: v2.6.21-rc1~274^2~356 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4a3b0a490d49ada8bbf3f426be1a0ace4dcd0a55;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: Jan Blunck Cc: Al Viro Cc: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/inode.c b/fs/inode.c index 6cacdab25e0..062c5f9b6a6 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 /*