From patchwork Wed May 15 07:48:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 2570231 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id EFB78DFE75 for ; Wed, 15 May 2013 07:48:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757172Ab3EOHsm (ORCPT ); Wed, 15 May 2013 03:48:42 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:48578 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1757021Ab3EOHsl (ORCPT ); Wed, 15 May 2013 03:48:41 -0400 X-IronPort-AV: E=Sophos;i="4.87,676,1363104000"; d="scan'208";a="7274579" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 15 May 2013 15:45:48 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r4F7mZsn008129; Wed, 15 May 2013 15:48:36 +0800 Received: from btrfs.fnst.cn.fujitsu.com ([10.167.234.170]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013051515472846-1246907 ; Wed, 15 May 2013 15:47:28 +0800 From: Miao Xie To: linux-btrfs@vger.kernel.org Cc: alex.btrfs@zadarastorage.com Subject: [PATCH 07/17] Btrfs: don't invoke btrfs_invalidate_inodes() in the spin lock context Date: Wed, 15 May 2013 15:48:21 +0800 Message-Id: <1368604111-25073-8-git-send-email-miaox@cn.fujitsu.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1368604111-25073-1-git-send-email-miaox@cn.fujitsu.com> References: <1368604111-25073-1-git-send-email-miaox@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/05/15 15:47:28, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/05/15 15:47:30, Serialize complete at 2013/05/15 15:47:30 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org btrfs_invalidate_inodes() may sleep, so we should not invoke it in the spin lock context. Fix it. Signed-off-by: Miao Xie --- fs/btrfs/disk-io.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 642c861..724a0da 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3685,8 +3685,11 @@ static void btrfs_destroy_ordered_operations(struct btrfs_transaction *t, ordered_operations); list_del_init(&btrfs_inode->ordered_operations); + spin_unlock(&root->fs_info->ordered_extent_lock); btrfs_invalidate_inodes(btrfs_inode->root); + + spin_lock(&root->fs_info->ordered_extent_lock); } spin_unlock(&root->fs_info->ordered_extent_lock); @@ -3808,8 +3811,11 @@ static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root) list_del_init(&btrfs_inode->delalloc_inodes); clear_bit(BTRFS_INODE_IN_DELALLOC_LIST, &btrfs_inode->runtime_flags); + spin_unlock(&root->fs_info->delalloc_lock); btrfs_invalidate_inodes(btrfs_inode->root); + + spin_lock(&root->fs_info->delalloc_lock); } spin_unlock(&root->fs_info->delalloc_lock);