From patchwork Sat Sep 21 02:26:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 2921981 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6C82ABFF05 for ; Sat, 21 Sep 2013 02:26:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 865B0204F6 for ; Sat, 21 Sep 2013 02:26:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C7DE204EB for ; Sat, 21 Sep 2013 02:26:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752071Ab3IUC0d (ORCPT ); Fri, 20 Sep 2013 22:26:33 -0400 Received: from dkim2.fusionio.com ([66.114.96.54]:33113 "EHLO dkim2.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751880Ab3IUC0c (ORCPT ); Fri, 20 Sep 2013 22:26:32 -0400 Received: from mx2.fusionio.com (unknown [10.101.1.160]) by dkim2.fusionio.com (Postfix) with ESMTP id 04E829A068A for ; Fri, 20 Sep 2013 20:26:32 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1379730392; bh=fYHOo0FZk+GHs47Kpe4mZPyZDyp2PPBrBwky8ixg4p0=; h=Date:From:To:Subject; b=nsO26G3ORxUgQc4Y5iFoqvwVObw0d3LRAIJsYeM3iGhlN7XM2z/JzbGFWL3el8PBd xFscJpxNA/E8DuA3MYDbtHfN4zAy2QUil1HyP5jD2ST6Rfx9Jsps+q2pMOvE20forP eJFXB1YhE8X7+Ey+aCeNqEH+ezysZ7maVgGVyDB4= X-ASG-Debug-ID: 1379730391-0421b5022041d880001-6jHSXT Received: from CAS1.int.fusionio.com (cas1.int.fusionio.com [10.101.1.40]) by mx2.fusionio.com with ESMTP id 9mhsA1ivL1PsUexJ (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO) for ; Fri, 20 Sep 2013 20:26:31 -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, 20 Sep 2013 20:26:30 -0600 Date: Fri, 20 Sep 2013 22:26:29 -0400 From: Josef Bacik To: Subject: [PATCH] Btrfs: reset intwrite on transaction abort Message-ID: <20130921022629.GC5672@localhost.localdomain> X-ASG-Orig-Subj: [PATCH] Btrfs: reset intwrite on transaction abort MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2011-07-01) X-Originating-IP: [10.101.1.160] X-Barracuda-Connect: cas1.int.fusionio.com[10.101.1.40] X-Barracuda-Start-Time: 1379730391 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.101.1.181:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at fusionio.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global 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.140796 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.4 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 If we abort a transaction in the middle of a commit we weren't undoing the intwrite locking. This patch fixes that problem. Signed-off-by: Josef Bacik --- fs/btrfs/transaction.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index e7a9535..2fa7017 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1552,6 +1552,8 @@ static void cleanup_transaction(struct btrfs_trans_handle *trans, root->fs_info->running_transaction = NULL; spin_unlock(&root->fs_info->trans_lock); + if (trans->type & __TRANS_FREEZABLE) + sb_end_intwrite(root->fs_info->sb); put_transaction(cur_trans); put_transaction(cur_trans);