From patchwork Tue Aug 21 06:24:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 1352531 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B8CE73FC81 for ; Tue, 21 Aug 2012 06:43:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752488Ab2HUGnw (ORCPT ); Tue, 21 Aug 2012 02:43:52 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:35246 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751942Ab2HUGnv (ORCPT ); Tue, 21 Aug 2012 02:43:51 -0400 X-IronPort-AV: E=Sophos;i="4.77,801,1336320000"; d="scan'208";a="5681238" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 21 Aug 2012 14:42:43 +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 q7L6Oneo007851; Tue, 21 Aug 2012 14:24:50 +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 2012082114245110-397916 ; Tue, 21 Aug 2012 14:24:51 +0800 Message-ID: <50332993.1000902@cn.fujitsu.com> Date: Tue, 21 Aug 2012 14:24:19 +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 , David Sterba Subject: Re: [RFC PATCH] Btrfs: fix full backref problem when inserting shared block reference References: <50232A19.2010704@cn.fujitsu.com> <20120809064802.GB17430@twin.jikos.cz> <20120809072129.GC17430@twin.jikos.cz> In-Reply-To: <20120809072129.GC17430@twin.jikos.cz> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/08/21 14:24:51, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/08/21 14:24:54, Serialize complete at 2012/08/21 14:24:54 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Thu, 9 Aug 2012 09:21:29 +0200, David Sterba wrote: > On Thu, Aug 09, 2012 at 08:48:02AM +0200, David Sterba wrote: >> and down, no problems so far, and the "wikipedia" test-subvol stresstest >> that caused trouble to one of your patches is also ok. I'll do some more >> testing on other machines and will report problems eventually. > > So it won't be so easy :) > > The test generated 15+ G of data, ~500 snapshots, then umount and fsck: > > lots of > > ref mismatch on [9655283712 4096] extent item 1, found 0 > Incorrect local backref count on 9655283712 root 5 owner 589776 offset 110592 found 0 wanted 1 back 0x86badf0 > backpointer mismatch on [9655283712 4096] > owner ref check failed [9655283712 4096] By debuging, I found it should be a bug of btrfsck. Could you try this patch? Thanks Miao From 77e9bcaae464354c0b0176631ba51374e3d31cfc Mon Sep 17 00:00:00 2001 From: Miao Xie Date: Tue, 21 Aug 2012 14:16:27 +0800 Subject: [PATCH] Btrfs-progs: fix wrong return value of check_owner_ref() If we find the block by seach corresponding fs tree, we should return 0, and tell the caller we pass the check. Signed-off-by: Miao Xie --- 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;