From patchwork Wed Aug 29 05:27:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 1383851 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 CE7ABDF215 for ; Wed, 29 Aug 2012 06:00:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751246Ab2H2GAF (ORCPT ); Wed, 29 Aug 2012 02:00:05 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:47833 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751135Ab2H2GAE (ORCPT ); Wed, 29 Aug 2012 02:00:04 -0400 X-IronPort-AV: E=Sophos;i="4.80,332,1344182400"; d="scan'208";a="5744866" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 29 Aug 2012 13:58:53 +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 q7T5Re3e002919 for ; Wed, 29 Aug 2012 13:27:41 +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 2012082913272926-538355 ; Wed, 29 Aug 2012 13:27:29 +0800 Message-ID: <503DA836.3060804@cn.fujitsu.com> Date: Wed, 29 Aug 2012 13:27:18 +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] Btrfs-progs: fix wrong return value of check_owner_ref() X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/08/29 13:27:29, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/08/29 13:27:29, Serialize complete at 2012/08/29 13:27:29 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org If we find the block by seach corresponding fs tree, we should return 0, and tell the caller we pass the check. Or btrfsck will fail to read the fs/file tree and report many error message by mistake. Signed-off-by: Miao Xie --- Several days ago, I sent this patch as a reply. Now I send it as a independent patch mail. --- btrfsck.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/btrfsck.c b/btrfsck.c index 4e91769..57e7b57 100644 --- a/btrfsck.c +++ b/btrfsck.c @@ -1954,7 +1954,7 @@ static int check_owner_ref(struct btrfs_root *root, if (buf->start == btrfs_node_blockptr(path.nodes[level + 1], path.slots[level + 1])) - rec->owner_ref_checked = 1; + found = 1; btrfs_release_path(ref_root, &path); return found ? 0 : 1;