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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 687D6C433EF for ; Wed, 18 May 2022 08:48:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233496AbiERIsi (ORCPT ); Wed, 18 May 2022 04:48:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233450AbiERIsh (ORCPT ); Wed, 18 May 2022 04:48:37 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D8821356AB for ; Wed, 18 May 2022 01:48:36 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 78E8368AFE; Wed, 18 May 2022 10:48:33 +0200 (CEST) Date: Wed, 18 May 2022 10:48:33 +0200 From: Christoph Hellwig To: Qu Wenruo Cc: Christoph Hellwig , Chris Mason , Josef Bacik , David Sterba , Qu Wenruo , linux-btrfs@vger.kernel.org Subject: Re: [PATCH 08/15] btrfs: refactor end_bio_extent_readpage Message-ID: <20220518084833.GF6933@lst.de> References: <20220517145039.3202184-1-hch@lst.de> <20220517145039.3202184-9-hch@lst.de> <5dc10aca-29ce-9318-c8f9-9ea83b35dde1@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5dc10aca-29ce-9318-c8f9-9ea83b35dde1@gmx.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Wed, May 18, 2022 at 06:22:54AM +0800, Qu Wenruo wrote: >> + } else if (is_data_inode(inode)) { >> + /* >> + * Only try to repair bios that actually made it to a >> + * device. If the bio failed to be submitted mirror >> + * is 0 and we need to fail it without retrying. >> + */ >> + if (mirror > 0) >> + repair = true; > > In fact, you can do it even better, by also checking the number of > copies the bio has. That's done first thing in the actual new repair code.