Patchwork [3/4] Ext4: use try_to_writeback_inodes_sb() instead of writeback_inodes_sb_if_idle()

login
register
mail settings
Submitter Miao Xie
Date April 26, 2012, 2:58 a.m.
Message ID <4F98B9C3.7060809@gmail.com>
Download mbox | patch
Permalink /patch/155149/
State New
Headers show

Comments

Miao Xie - April 26, 2012, 2:58 a.m.
If the s_umount is write locked, then the sb is not idle. IOWs,
writeback_inodes_sb...if_idle() should be doing down_read_trylock(),
not down_read(). So use try_to_writeback_inodes_sb() instead of
writeback_inodes_sb_if_idle().

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
 fs/ext4/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index c77b0bd..2dccb4d 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2380,7 +2380,7 @@  static int ext4_nonda_switch(struct super_block *sb)
 	 * start pushing delalloc when 1/2 of free blocks are dirty.
 	 */
 	if (free_blocks < 2 * dirty_blocks)
-		writeback_inodes_sb_if_idle(sb, WB_REASON_FS_FREE_SPACE);
+		try_to_writeback_inodes_sb(sb, WB_REASON_FS_FREE_SPACE);
 
 	return 0;
 }