From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A029DC12002 for ; Wed, 21 Jul 2021 17:35:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A8166023B for ; Wed, 21 Jul 2021 17:35:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229870AbhGUQzH (ORCPT ); Wed, 21 Jul 2021 12:55:07 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:52890 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229767AbhGUQzH (ORCPT ); Wed, 21 Jul 2021 12:55:07 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id BE4A822497; Wed, 21 Jul 2021 17:35:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1626888942; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vdM34uScEulloRuDsYtcl7lmcehRhE8UOvArhjA3Upg=; b=gzaoXlcsMvleQAQMf9yUd4jAHyNd0bE/yQCmxHu5Sgi3mtV/+wTrJv0xVumTrL6ANTTCqc hBkcAh74AS+c7tgmVBIElb3j9MMdzLm+nDc4xdqJFVVGTpBa57T5yu0Vp7XwNKyfI1yOHg V14qTq4JtwJsPQj9dVLVadICbFUze6Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1626888942; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vdM34uScEulloRuDsYtcl7lmcehRhE8UOvArhjA3Upg=; b=+Usa1kH2kvsR0qGq18Vp7vH+cSJ5r09IfcWw5WcWKfHA6cUYVIgJEHYCKukN8N42jeCbPe Ci1KGdPMAetxGKBA== Received: from ds.suse.cz (ds.suse.cz [10.100.12.205]) by relay2.suse.de (Postfix) with ESMTP id B61FFA3B83; Wed, 21 Jul 2021 17:35:42 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 86913DA704; Wed, 21 Jul 2021 19:33:01 +0200 (CEST) Date: Wed, 21 Jul 2021 19:33:01 +0200 From: David Sterba To: Qu Wenruo Cc: linux-btrfs@vger.kernel.org, Zhenyu Wu Subject: Re: [PATCH v4] btrfs: rescue: allow ibadroots to skip bad extent tree when reading block group items Message-ID: <20210721173301.GM19710@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Qu Wenruo , linux-btrfs@vger.kernel.org, Zhenyu Wu References: <20210719054304.181509-1-wqu@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210719054304.181509-1-wqu@suse.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Mon, Jul 19, 2021 at 01:43:04PM +0800, Qu Wenruo wrote: > When extent tree gets corrupted, normally it's not extent tree root, but > one toasted tree leaf/node. > > In that case, rescue=ibadroots mount option won't help as it can only > handle the extent tree root corruption. > > This patch will enhance the behavior by: > > - Allow fill_dummy_bgs() to ignore -EEXIST error > > This means we may have some block group items read from disk, but > then hit some error halfway. > > - Fallback to fill_dummy_bgs() if any error gets hit in > btrfs_read_block_groups() > > Of course, this still needs rescue=ibadroots mount option. > > With that, rescue=ibadroots can handle extent tree corruption more > gracefully and allow a better recover chance. > > Reported-by: Zhenyu Wu > Link: https://www.spinics.net/lists/linux-btrfs/msg114424.html > Signed-off-by: Qu Wenruo > --- > Changelog: > v2: > - Don't try to fill with dummy block groups when we hit ENOMEM > v3: > - Remove a dead condition > The empty fs_info->extent_root case has already been handled. > v4: > - Skip to next block group if we hit EEXIST when inserting the block > group cache Added to misc-next, thanks.