Skip to content

Commit 9843b76

Browse files
Christoph HellwigAl Viro
authored andcommitted
fs: skip I_FREEING inodes in writeback_sb_inodes
Skip I_FREEING inodes just like I_WILL_FREE and I_NEW when walking the writeback lists. Currenly this can't happen, but once we move from inode_lock to more fine grained locking we can have an inode that's still on the writeback lists but has I_FREEING set, and we absolutely need to skip it here, just like we do for all other inode list walks. Based on a patch from Dave Chinner. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent a031878 commit 9843b76

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

fs/fs-writeback.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,18 +487,23 @@ static int writeback_sb_inodes(struct super_block *sb, struct bdi_writeback *wb,
487487
return 0;
488488
}
489489

490-
if (inode->i_state & (I_NEW | I_WILL_FREE)) {
490+
/*
491+
* Don't bother with new inodes or inodes beeing freed, first
492+
* kind does not need peridic writeout yet, and for the latter
493+
* kind writeout is handled by the freer.
494+
*/
495+
if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) {
491496
requeue_io(inode);
492497
continue;
493498
}
499+
494500
/*
495501
* Was this inode dirtied after sync_sb_inodes was called?
496502
* This keeps sync from extra jobs and livelock.
497503
*/
498504
if (inode_dirtied_after(inode, wbc->wb_start))
499505
return 1;
500506

501-
BUG_ON(inode->i_state & I_FREEING);
502507
__iget(inode);
503508
pages_skipped = wbc->pages_skipped;
504509
writeback_single_inode(inode, wbc);

0 commit comments

Comments
 (0)