From patchwork Fri Oct 18 16:10:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 3068871 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C21059F243 for ; Fri, 18 Oct 2013 16:10:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F15F2017E for ; Fri, 18 Oct 2013 16:10:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E342203E9 for ; Fri, 18 Oct 2013 16:10:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754483Ab3JRQKm (ORCPT ); Fri, 18 Oct 2013 12:10:42 -0400 Received: from dkim1.fusionio.com ([66.114.96.53]:36469 "EHLO dkim1.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751684Ab3JRQKl (ORCPT ); Fri, 18 Oct 2013 12:10:41 -0400 Received: from mx1.fusionio.com (unknown [10.101.1.160]) by dkim1.fusionio.com (Postfix) with ESMTP id AA2AD7C06B4 for ; Fri, 18 Oct 2013 10:10:41 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1382112641; bh=WHbSKIHmzmdS3hdSDrXFSB8MZn6vWfTNAhSzaR2Fsts=; h=From:To:Subject:Date; b=Djw0t3yKRYt3iKjPNoF4+dn019hBQDt3XhT4A+S8sqvS/0YJFzBfnx15J5F+rFvDu A8oZ1q3i/3Tupd2xHtoqR3E7YMLJjyf7bhufQe1MHNBV40/gore6Xz/xaoZVa2PZKr 0RbfJJbKR1jR2ms+xT2nxT82n7kQd347e/BXdLr0= X-ASG-Debug-ID: 1382112641-03d6a51949135250001-6jHSXT Received: from CAS1.int.fusionio.com (cas1.int.fusionio.com [10.101.1.40]) by mx1.fusionio.com with ESMTP id 1ytad8CNABplZk0v (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO) for ; Fri, 18 Oct 2013 10:10:41 -0600 (MDT) X-Barracuda-Envelope-From: JBacik@fusionio.com Received: from localhost (10.101.1.160) by mail.fusionio.com (10.101.1.40) with Microsoft SMTP Server (TLS) id 14.3.158.1; Fri, 18 Oct 2013 10:10:37 -0600 From: Josef Bacik To: Subject: [PATCH] Btrfs: release path before starting transaction in can_nocow_extent Date: Fri, 18 Oct 2013 12:10:36 -0400 X-ASG-Orig-Subj: [PATCH] Btrfs: release path before starting transaction in can_nocow_extent Message-ID: <1382112636-13603-1-git-send-email-jbacik@fusionio.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.101.1.160] X-Barracuda-Connect: cas1.int.fusionio.com[10.101.1.40] X-Barracuda-Start-Time: 1382112641 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.101.1.180:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at fusionio.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.1036 1.0000 -1.3708 X-Barracuda-Spam-Score: -1.37 X-Barracuda-Spam-Status: No, SCORE=-1.37 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.141570 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We can't be holding tree locks while we try to start a transaction, we will deadlock. Thanks, Reported-by: Sage Weil Signed-off-by: Josef Bacik --- fs/btrfs/inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 974323a..30bdacd 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6452,6 +6452,7 @@ noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len, if (btrfs_extent_readonly(root, disk_bytenr)) goto out; + btrfs_release_path(path); /* * look for other files referencing this extent, if we