From patchwork Wed Oct 7 08:45:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 7343131 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 46A169F443 for ; Wed, 7 Oct 2015 08:47:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7BD8B2062A for ; Wed, 7 Oct 2015 08:47:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82F92205E5 for ; Wed, 7 Oct 2015 08:47:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752258AbbJGIrH (ORCPT ); Wed, 7 Oct 2015 04:47:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:33062 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752249AbbJGIrD (ORCPT ); Wed, 7 Oct 2015 04:47:03 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 30BA2AABB; Wed, 7 Oct 2015 08:47:00 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id DC552DAAC0; Wed, 7 Oct 2015 10:45:56 +0200 (CEST) Date: Wed, 7 Oct 2015 10:45:56 +0200 From: David Sterba To: Josef Bacik Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH] Btrfs: fix qgroup sanity tests Message-ID: <20151007084556.GB7734@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Josef Bacik , linux-btrfs@vger.kernel.org, kernel-team@fb.com References: <1444057388-10949-1-git-send-email-jbacik@fb.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1444057388-10949-1-git-send-email-jbacik@fb.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 On Mon, Oct 05, 2015 at 11:03:08AM -0400, Josef Bacik wrote: > +#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 The inline ifdefs are not necessary, please use the helper --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -362,13 +362,12 @@ 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))) { + if (btrfs_test_is_dummy_root(root)) { 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)