From: Nick Piggin Subject: [patch] fs: remove incorrect I_NEW warnings Date: Tue, 2 Jun 2009 12:07:47 +0200 Message-ID: <20090602100747.GA2900@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Stephen Hemminger , linux-fsdevel@vger.kernel.org To: Al Viro , stable@kernel.org Return-path: Received: from cantor2.suse.de ([195.135.220.15]:57626 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754674AbZFBKHp (ORCPT ); Tue, 2 Jun 2009 06:07:45 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Some filesystems can call in to sync an inode that is still in the I_NEW state (eg. ext family, when mounted with -osync). This is OK because the filesystem has sole access to the new inode, so it can modify i_state without races (because no other thread should be modifying it, by definition of I_NEW). Ie. a false positive, so remove the warnings. The races are described here 7ef0d7377cb287e08f3ae94cebc919448e1f5dff, which is also where the warnings were introduced. Reported-by: Stephen Hemminger Signed-off-by: Nick Piggin --- fs/fs-writeback.c | 2 -- 1 file changed, 2 deletions(-) Index: linux-2.6/fs/fs-writeback.c =================================================================== --- linux-2.6.orig/fs/fs-writeback.c +++ linux-2.6/fs/fs-writeback.c @@ -289,7 +289,6 @@ __sync_single_inode(struct inode *inode, int ret; BUG_ON(inode->i_state & I_SYNC); - WARN_ON(inode->i_state & I_NEW); /* Set I_SYNC, reset I_DIRTY */ dirty = inode->i_state & I_DIRTY; @@ -314,7 +313,6 @@ __sync_single_inode(struct inode *inode, } spin_lock(&inode_lock); - WARN_ON(inode->i_state & I_NEW); inode->i_state &= ~I_SYNC; if (!(inode->i_state & I_FREEING)) { if (!(inode->i_state & I_DIRTY) &&