From patchwork Thu Apr 26 02:58:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3/4] Ext4: use try_to_writeback_inodes_sb() instead of writeback_inodes_sb_if_idle() Date: Wed, 25 Apr 2012 16:58:11 -0000 From: Miao Xie X-Patchwork-Id: 155149 Message-Id: <4F98B9C3.7060809@gmail.com> To: Theodore Ts'o Cc: Linux Ext4 , miaox@cn.fujitsu.com, Linux FSDevel 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 --- fs/ext4/inode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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; }