From patchwork Thu Apr 26 02:58:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 155149 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A2B2AB6FF1 for ; Thu, 26 Apr 2012 12:58:41 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753418Ab2DZC6d (ORCPT ); Wed, 25 Apr 2012 22:58:33 -0400 Received: from mail-pz0-f51.google.com ([209.85.210.51]:65426 "EHLO mail-pz0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753336Ab2DZC60 (ORCPT ); Wed, 25 Apr 2012 22:58:26 -0400 Received: by mail-pz0-f51.google.com with SMTP id z8so904491dad.10 for ; Wed, 25 Apr 2012 19:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:reply-to:organization:user-agent:mime-version :to:cc:subject:content-type:content-transfer-encoding; bh=E7fayYjgkdOtVZbpEB4DuyxWgbfK8o4sSpZLXfbD9Ho=; b=iAQC7kOwuG6NHKGBGDSXKBWk4xn1RRGI99mdERR+O7WCL9T9DGoinUW+o8iz9sxurv V+2Ww8WxnXj9pZGNrYHFXp48t0Q1To2sgqA2oUmMOIqTWpa57Udw5r04lcAlCM6UVXZu dXTm7oZ7auUJ3F47fGJvIHlVET0rD9l8O+aipED4Eq22b1pTjIclCRkiPUkVUPT9nr2u rvKLT364poHWUsCRYaXE7x4FHYUDKkXSTGBSITVHiixIyNsdBD11RU7aiyNhTw3ApSVc JY18KF8VtsLT3CbZizu8TEfCyOEpSW/0IGwnK75Yh7CE0YIejvzVSDh2kJpiYJbalIIF HEug== Received: by 10.68.194.227 with SMTP id hz3mr11729030pbc.23.1335409106211; Wed, 25 Apr 2012 19:58:26 -0700 (PDT) Received: from [192.168.1.101] ([117.89.16.6]) by mx.google.com with ESMTPS id ip6sm1899569pbc.16.2012.04.25.19.58.20 (version=SSLv3 cipher=OTHER); Wed, 25 Apr 2012 19:58:25 -0700 (PDT) Message-ID: <4F98B9C3.7060809@gmail.com> Date: Thu, 26 Apr 2012 10:58:11 +0800 From: Miao Xie Reply-To: miaoxie1984@gmail.com Organization: Fujitsu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Theodore Ts'o CC: Linux Ext4 , miaox@cn.fujitsu.com, Linux FSDevel Subject: [PATCH 3/4] Ext4: use try_to_writeback_inodes_sb() instead of writeback_inodes_sb_if_idle() Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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; }