Skip to content

Commit

Permalink
fs: remove incorrect I_NEW warnings
Browse files Browse the repository at this point in the history
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 7ef0d73,
which is also where the warnings were introduced.

Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Nick Piggin authored and Al Viro committed Jun 12, 2009
1 parent 8688b86 commit 545b9fd
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc)
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;
Expand All @@ -314,7 +313,6 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc)
}

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) &&
Expand Down

0 comments on commit 545b9fd

Please sign in to comment.