Skip to content

Commit

Permalink
Write back inode data pages even when the inode itself is locked
Browse files Browse the repository at this point in the history
In __writeback_single_inode(), when we find a locked inode and we're not
doing a data-integrity sync, we used to just skip writing entirely,
since we didn't want to wait for the inode to unlock.

However, there's really no reason to skip writing the data pages, which
are likely to be the the bulk of the dirty state anyway (and the main
reason why writeback was started for the non-data-integrity case, of
course!)

Acked-by: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Andrew Morton <akpm@osdl.org>,
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed Jan 26, 2007
1 parent ecdfc97 commit 4b89eed
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,19 @@ __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_LOCK)) {
struct address_space *mapping = inode->i_mapping;
int ret;

list_move(&inode->i_list, &inode->i_sb->s_dirty);
return 0;

/*
* 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;
}

/*
Expand Down

0 comments on commit 4b89eed

Please sign in to comment.