Skip to content

Commit

Permalink
skip writing data pages when inode is under I_SYNC
Browse files Browse the repository at this point in the history
Since I_SYNC was split out from I_LOCK, the concern in commit
4b89eed ("Write back inode data pages
even when the inode itself is locked") is not longer valid.

We should revert to the original behavior: in __writeback_single_inode(),
when we find an I_SYNC-ed inode and we're not doing a data-integrity sync,
skip writing entirely.  Otherwise, we are double calling do_writepages()

Signed-off-by: Qi Yong <qiyong@fc-cn.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Joern Engel <joern@wohnheim.fh-wedel.de>
Cc: WU Fengguang <wfg@mail.ustc.edu.cn>
Cc: Michael Rubin <mrubin@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Qi Yong authored and Linus Torvalds committed Feb 5, 2008
1 parent 5a9bbdc commit 2d54456
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,6 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
WARN_ON(inode->i_state & I_WILL_FREE);

if ((wbc->sync_mode != WB_SYNC_ALL) && (inode->i_state & I_SYNC)) {
struct address_space *mapping = inode->i_mapping;
int ret;

/*
* We're skipping this inode because it's locked, and we're not
* doing writeback-for-data-integrity. Move it to s_more_io so
Expand All @@ -345,15 +342,7 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
* completed a full scan of s_io.
*/
requeue_io(inode);

/*
* Even if we don't actually write the inode itself here,
* we can at least start some of the data writeout..
*/
spin_unlock(&inode_lock);
ret = do_writepages(mapping, wbc);
spin_lock(&inode_lock);
return ret;
return 0;
}

/*
Expand Down

0 comments on commit 2d54456

Please sign in to comment.