Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2172749imm; Mon, 28 May 2018 03:11:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrYu7wAy0bb5l3DzDMtvGKnLFOTaQIU87+eFTvBePvFeoM293QUfTChepKqW2P7Jxl7NqZ0 X-Received: by 2002:a17:902:7595:: with SMTP id j21-v6mr12976493pll.347.1527502295202; Mon, 28 May 2018 03:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527502295; cv=none; d=google.com; s=arc-20160816; b=J1jJTPW1y3eRTIp+8ZixWJpWPFmmSbRYVFdmS1Dx79IgleMNxI46oVI5Jb7z9hA+5s mg8zcSt64enZtcxsxODycMtxVnzY2hhsAlaBYlB/qu2vzvax6uyig9ac83AR4OSN2A9M pym74liPr2qkQgsbO70JcGogBKbtvzHdUG9tcyhprFGn9HrydDFbzwINbKCc4g+s0RBx APdnGOyys/IpPF21myblenykzH96FNplKISKkta+xEDmVNM+uV0wfcI0tgPVcAz0EtXa i0JI8S7ikjjCwTonLvJMQC8ds5E5vepkixbLbUegOAhNFVTgzej0f2wdELNM2VeVhrGM 1w9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=VT0iZNSBwx/TPwo7lDGLBlUEUhmySsa5EAMnP0kbvgs=; b=aWsv0JcnTEM2V3WoJDFQ0Srob8llAkBLOn00j5i7jwELvz3ErVlUj8fuO8fEEX7VqZ MO6a+3YPQ86tRW3SDQ1NqzMzLPVucN8lTA4FiNVpgKs8rXASVwBkopzLVIk4I/SPM5gd +p/a5OciS8yxNYG0n3WLyiIyZJl8PUJDbsoydiKLFYPG7L8u/O8xpKCW2KPh4WFkJvW5 N3pvgfSNgXHkMEDHF+fYlT67ej6LGgybyRDEmTI2lGX3xIWpiIQp9XsHDgiDn2YuAFQS AAa9lhA0w7H5Djiw8EHydL0tt5bjPDYKQhL0+vjLHcw+DA32L4Rds+lpOig+wZ4rDlAV LJsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oTrWEw+S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4-v6si28564475plt.430.2018.05.28.03.11.20; Mon, 28 May 2018 03:11:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oTrWEw+S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964987AbeE1KLN (ORCPT + 99 others); Mon, 28 May 2018 06:11:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:59402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935505AbeE1KLK (ORCPT ); Mon, 28 May 2018 06:11:10 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4EE3D208A6; Mon, 28 May 2018 10:11:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502269; bh=rcGdBsG7NQQO1FsE1xV7SmY9LXs40gCCP2fFrg9Xkko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oTrWEw+S8B5Nqw2ybktCRGOS2Ph/0KxgGcPs7SD9iS1oE1SEofKVoNOJCP8F5Hy4e IYhywWMVBZHUKQ9GXij2ZQS/QlKGIu25VRYulUJwr5z+tkx5KyIF1dpvB+m0XAoV6J N7q6+cYWThcxPRNYXZ/06D9yh9/n8BCTtfZOR8tI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qu Wenruo , David Sterba , Sasha Levin Subject: [PATCH 3.18 124/185] btrfs: tests/qgroup: Fix wrong tree backref level Date: Mon, 28 May 2018 12:02:45 +0200 Message-Id: <20180528100103.194335733@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100050.700971285@linuxfoundation.org> References: <20180528100050.700971285@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Qu Wenruo [ Upstream commit 3c0efdf03b2d127f0e40e30db4e7aa0429b1b79a ] The extent tree of the test fs is like the following: BTRFS info (device (null)): leaf 16327509003777336587 total ptrs 1 free space 3919 item 0 key (4096 168 4096) itemoff 3944 itemsize 51 extent refs 1 gen 1 flags 2 tree block key (68719476736 0 0) level 1 ^^^^^^^ ref#0: tree block backref root 5 And it's using an empty tree for fs tree, so there is no way that its level can be 1. For REAL (created by mkfs) fs tree backref with no skinny metadata, the result should look like: item 3 key (30408704 EXTENT_ITEM 4096) itemoff 3845 itemsize 51 refs 1 gen 4 flags TREE_BLOCK tree block key (256 INODE_ITEM 0) level 0 ^^^^^^^ tree block backref root 5 Fix the level to 0, so it won't break later tree level checker. Fixes: faa2dbf004e8 ("Btrfs: add sanity tests for new qgroup accounting code") Signed-off-by: Qu Wenruo Signed-off-by: David Sterba Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/tests/qgroup-tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/tests/qgroup-tests.c +++ b/fs/btrfs/tests/qgroup-tests.c @@ -69,7 +69,7 @@ static int insert_normal_tree_ref(struct btrfs_set_extent_generation(leaf, item, 1); btrfs_set_extent_flags(leaf, item, BTRFS_EXTENT_FLAG_TREE_BLOCK); block_info = (struct btrfs_tree_block_info *)(item + 1); - btrfs_set_tree_block_level(leaf, block_info, 1); + btrfs_set_tree_block_level(leaf, block_info, 0); iref = (struct btrfs_extent_inline_ref *)(block_info + 1); if (parent > 0) { btrfs_set_extent_inline_ref_type(leaf, iref,