From patchwork Fri Aug 10 08:53:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 1304571 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 203AEDFFEB for ; Fri, 10 Aug 2012 08:54:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755324Ab2HJIyY (ORCPT ); Fri, 10 Aug 2012 04:54:24 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:8547 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1755209Ab2HJIyW (ORCPT ); Fri, 10 Aug 2012 04:54:22 -0400 X-IronPort-AV: E=Sophos;i="4.77,744,1336320000"; d="scan'208";a="5598857" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 10 Aug 2012 16:53:19 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id q7A8sL9K011830 for ; Fri, 10 Aug 2012 16:54:21 +0800 Received: from [10.167.225.199] ([10.167.225.199]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012081016543941-254491 ; Fri, 10 Aug 2012 16:54:39 +0800 Message-ID: <5024CC11.6030905@cn.fujitsu.com> Date: Fri, 10 Aug 2012 16:53:37 +0800 From: Miao Xie Reply-To: miaox@cn.fujitsu.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Linux Btrfs Subject: [PATCH V2 2/3] Btrfs-progs: fix wrong leaf when checking the trees relationship X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/08/10 16:54:39, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/08/10 16:54:40, Serialize complete at 2012/08/10 16:54:40 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The variant named 'leaf' in is_child_root() still hold old result after we get the next leaf, it make btrfsck returns the wrong result, such as "unresolved ref root ..", fix it. Signed-off-by: Miao Xie --- Changelog v1 -> v2: - just change the title of this patch. --- btrfsck.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/btrfsck.c b/btrfsck.c index 088b9f4..bb1aa76 100644 --- a/btrfsck.c +++ b/btrfsck.c @@ -786,6 +786,7 @@ static int is_child_root(struct btrfs_root *root, u64 parent_root_id, if (ret > 0) break; + leaf = path.nodes[0]; } btrfs_item_key_to_cpu(leaf, &key, path.slots[0]);