From patchwork Wed Mar 14 08:53:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dirk Gouders X-Patchwork-Id: 10281669 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9255602C2 for ; Wed, 14 Mar 2018 08:54:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAD6E28791 for ; Wed, 14 Mar 2018 08:54:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF02428796; Wed, 14 Mar 2018 08:54:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00, DKIM_ADSP_DISCARD, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B84B028791 for ; Wed, 14 Mar 2018 08:54:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751430AbeCNIyD (ORCPT ); Wed, 14 Mar 2018 04:54:03 -0400 Received: from services.gouders.net ([141.101.32.176]:33163 "EHLO services.gouders.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750860AbeCNIyC (ORCPT ); Wed, 14 Mar 2018 04:54:02 -0400 Received: from localhost ([193.175.198.193]) (authenticated bits=0) by services.gouders.net (8.14.8/8.14.8) with ESMTP id w2E8sARD019736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Mar 2018 09:54:11 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gouders.net; s=gnet; t=1521017651; bh=/LZL6glj4fwwmAX7oxbn1A+NLpA+HGHwyH8FwTS+f6Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Jg/c/iIDG3Heo/9Ux8tJOiEqZfpnZBGyZJGQ1Hb/BcPzjzL0zCmAtpV+ki1kEal8Q ucSHVauUzz8RiI88Qs35bQFhVCO0rQjKToEzNeV7qfrpygvgiEVbA2k0VO7lnXduwS leoLAHJqfXR2+tgwKmcyCTbaCcseddtk/5NBnK1g= From: Dirk Gouders To: Qu Wenruo Cc: Linux BTRFS mailing list Subject: Re: FS unmountable after RAID/LVM problems In-Reply-To: (Qu Wenruo's message of "Wed, 14 Mar 2018 08:40:11 +0800") References: <005e24f2-2638-74c3-5034-92c094671d80@gmx.com> <9dd85c04-2371-04df-8bd7-f07f8a92a044@gmx.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Date: Wed, 14 Mar 2018 09:53:54 +0100 Message-ID: MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Qu Wenruo writes: > On 2018年03月13日 22:49, Dirk Gouders wrote: > [snip] >>> >>> # btrfs inspect dump-tree -b 848986112 /dev/loop0p1 >>> # btrfs inspect dump-tree -b 72089600 /dev/loop0p1 >> >> OK. >> >> (This mail gets a bit long but I don't want to snip probably important >> information above.) >> > > Feel free to snip. > As the involved tree block is not shown anywhere. > > So it's not any root node corrupted. > It may be some extent tree node corrupted in this case. > > While to inspect it, we need some new functionality in btrfs inspect tree. > > Before that, would you please try the following patch and to see if it > helps btrfs-restore to salvage any data? I tried it and got the following output: # btrfs restore /dev/loop0p1 /mnt/ checksum verify failed on 363069440 found 296FB15A wanted F0AFE59D checksum verify failed on 363069440 found 296FB15A wanted F0AFE59D checksum verify failed on 363069440 found DC09290B wanted C630FD61 checksum verify failed on 363069440 found 296FB15A wanted F0AFE59D bytenr mismatch, want=363069440, have=17552567724568668829 Could not open root, trying backup super checksum verify failed on 363069440 found 296FB15A wanted F0AFE59D checksum verify failed on 363069440 found 296FB15A wanted F0AFE59D checksum verify failed on 363069440 found DC09290B wanted C630FD61 checksum verify failed on 363069440 found 296FB15A wanted F0AFE59D bytenr mismatch, want=363069440, have=17552567724568668829 Could not open root, trying backup super ERROR: superblock bytenr 274877906944 is larger than device size 10741612544 Could not open root, trying backup super Because the patch did not apply, I did the modification manually as follows: # git diff Thanks, Dirk --- 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 diff --git a/cmds-restore.c b/cmds-restore.c index ade35f0f..e7b96a67 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -1282,7 +1282,7 @@ static struct btrfs_root *open_fs(const char *dev, u64 root_location, for (i = super_mirror; i < BTRFS_SUPER_MIRROR_MAX; i++) { bytenr = btrfs_sb_offset(i); fs_info = open_ctree_fs_info(dev, bytenr, root_location, 0, - OPEN_CTREE_PARTIAL); + OPEN_CTREE_PARTIAL | __OPEN_CTREE_RETURN_CHUNK_ROOT); if (fs_info) break; fprintf(stderr, "Could not open root, trying backup super\n");