From patchwork Mon Oct 5 15:03:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 7328491 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 76CEDBEEA4 for ; Mon, 5 Oct 2015 15:05:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98E81206B1 for ; Mon, 5 Oct 2015 15:05:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA16F206A5 for ; Mon, 5 Oct 2015 15:05:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752136AbbJEPFh (ORCPT ); Mon, 5 Oct 2015 11:05:37 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:51686 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751967AbbJEPFg (ORCPT ); Mon, 5 Oct 2015 11:05:36 -0400 Received: from pps.filterd (m0001255 [127.0.0.1]) by mx0b-00082601.pphosted.com (8.14.5/8.14.5) with SMTP id t95F4pIH019254 for ; Mon, 5 Oct 2015 08:05:35 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : mime-version : content-type; s=facebook; bh=gw4wgA3v3nea5A7GTNIDNXmArGNpHR/IqlhqcCiCQjs=; b=YWAtYKEIH5t8MNSWx3MryvCVh/20PTJSbR07jv4j5bwJQSx0y5lk2ECaQ+8lbXJHlImd W0zwM0zist48vg5JTtpad0x3/i3UR/2Lycs4ze52po7W/51Ok/phrlPOUoogMk5e0p/W OuuyNIxFO2w18nUxZGquF2c9qgO2rJF1r5g= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0b-00082601.pphosted.com with ESMTP id 1xbtqs06h6-6 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Mon, 05 Oct 2015 08:05:35 -0700 Received: from localhost (192.168.54.13) by mail.thefacebook.com (192.168.16.15) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 5 Oct 2015 08:03:10 -0700 From: Josef Bacik To: , Subject: [PATCH] Btrfs: fix qgroup sanity tests Date: Mon, 5 Oct 2015 11:03:08 -0400 Message-ID: <1444057388-10949-1-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151, 1.0.33, 0.0.0000 definitions=2015-10-05_06:2015-10-05, 2015-10-05, 1970-01-01 signatures=0 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 With my changes to allow us to find old roots when resolving indirect refs I introduced a regression to the sanity tests. Since we don't really care to go down into the fs roots we just need to have the old behavior of returning ENOENT for dummy roots for the sanity tests. In the future if we want to get fancy we can populate the test fs trees with the references as well. Thanks, Signed-off-by: Josef Bacik --- fs/btrfs/backref.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 5de66e9..905d697 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -339,6 +339,13 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info, goto out; } +#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS + if (unlikely(test_bit(BTRFS_ROOT_DUMMY_ROOT, &root->state))) { + srcu_read_unlock(&fs_info->subvol_srcu, index); + ret = -ENOENT; + goto out; + } +#endif if (path->search_commit_root) root_level = btrfs_header_level(root->commit_root); else if (time_seq == (u64)-1)