From patchwork Wed Jun 25 20:45:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 4424521 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 649C49F1D6 for ; Wed, 25 Jun 2014 20:46:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F43020263 for ; Wed, 25 Jun 2014 20:46:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1D9B201B4 for ; Wed, 25 Jun 2014 20:46:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756222AbaFYUqK (ORCPT ); Wed, 25 Jun 2014 16:46:10 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:5251 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755121AbaFYUqG (ORCPT ); Wed, 25 Jun 2014 16:46:06 -0400 Received: from pps.filterd (m0004060 [127.0.0.1]) by mx0b-00082601.pphosted.com (8.14.5/8.14.5) with SMTP id s5PKk5N9027175; Wed, 25 Jun 2014 13:46:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=slWB68fxvU9Oxv5borQW7bsYI/IkhbW2IPWR5Pl6NQg=; b=no731x8Layuo1T9/283cb9IqtBij2rYQ2KoUINBuH88+5RSyjvqMoQPoKDxJhjvQbvpW r6bqucnwYAXOLkGdduRFiqotkQQzReADSaMtQZBAKHPB4VorrSn+yUmb3hDleaQEMJJt uwRlgB+rS5gyOX1rjR6ZhJ2YyZOrEWUgzAA= Received: from mail.thefacebook.com (mailwest.thefacebook.com [173.252.71.148]) by mx0b-00082601.pphosted.com with ESMTP id 1mqv051n1e-2 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK); Wed, 25 Jun 2014 13:46:05 -0700 Received: from prometheus.DHCP.TheFacebook.com (192.168.16.4) by mail.thefacebook.com (192.168.16.20) with Microsoft SMTP Server (TLS) id 14.3.174.1; Wed, 25 Jun 2014 13:45:59 -0700 From: Josef Bacik To: CC: Josef Bacik , Subject: [PATCH] btrfs: only unlock block in verify_parent_transid if we locked it Date: Wed, 25 Jun 2014 13:45:41 -0700 Message-ID: <1403729141-10434-1-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.0.0 MIME-Version: 1.0 X-Originating-IP: [192.168.16.4] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.12.52, 1.0.14, 0.0.0000 definitions=2014-06-25_06:2014-06-25, 2014-06-25, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 kscore.is_bulkscore=1.90902849084296e-13 kscore.compositescore=0 circleOfTrustscore=514.84 compositescore=0.999775624998249 urlsuspect_oldscore=0.999775624998249 suspectscore=1 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=64355 rbsscore=0.999775624998249 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1406250213 X-FB-Internal: deliver Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 This is a regression from my patch a26e8c9f75b0bfd8cccc9e8f110737b136eb5994, we need to only unlock the block if we were the one who locked it. Otherwise this will trip BUG_ON()'s in locking.c Thanks, cc: stable@vger.kernel.org Signed-off-by: Josef Bacik Reviewed-by: Liu Bo --- fs/btrfs/disk-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 8bb4aa1..f00165d 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -369,7 +369,8 @@ static int verify_parent_transid(struct extent_io_tree *io_tree, out: unlock_extent_cached(io_tree, eb->start, eb->start + eb->len - 1, &cached_state, GFP_NOFS); - btrfs_tree_read_unlock_blocking(eb); + if (need_lock) + btrfs_tree_read_unlock_blocking(eb); return ret; }