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 17A0DC433EF for ; Fri, 11 Feb 2022 22:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235436AbiBKW4R (ORCPT ); Fri, 11 Feb 2022 17:56:17 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiBKW4Q (ORCPT ); Fri, 11 Feb 2022 17:56:16 -0500 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8ADBC63 for ; Fri, 11 Feb 2022 14:56:14 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2B9F45C012B; Fri, 11 Feb 2022 17:56:14 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 11 Feb 2022 17:56:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bur.io; h=cc:cc :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; bh=5q8aspfP/8BDmZBcwoM/MV+0QorO4sAfH3hHx1 pwmXM=; b=IAbU5EBNrZ8lIJ/+QLYRBLNiyW2GscLYbHe2bdS9igs3/2zNDEN8Nl GQ7hM5Vp2a/6kXVVf3fQpmXTvFrpRK3aD3QN46lHj4WjpEX8g6b7IFu50d4tKhGK dXgdy4+WDGdx5PuHJ9TBMIq1cHEegUioHftHX1RrZMs6s+FJC8m2zxwDbpwRmUqe KAAWWDPZV2rIterWIh8rHpBn9h41AD7FmPYJmmSXSVcCYmT9s3g4G9MGfKDFNXtG liCVjytNBvRwrToeq+MWMkqSLOH4svWc8e/emowSEDzeG8KBY5xDAzOABztQ8Ewe 9fsr+WQ93eCtuoeu2L/wITnccj2D6FDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=5q8aspfP/8BDmZBcw oM/MV+0QorO4sAfH3hHx1pwmXM=; b=nqtIAYmSXmPIMYVSMMBqvNXRKMg+NGbqT hbk/ZrAMg+yRHwa06kaTxb+GuW5TSsry2/9zvozifUWhpGKrNKJ1MUGJYQTqR5FL uIp0SPE+mBqK9wp9C07DBW8XRfoDNQm1RQn05wrfTfInIwo+WUbbkgTifW1BZN2u JZRbCKIaauFRFTWE/3HTaSOaN0Lo35tKLxZ3MtRbmrwnKAqSNgpix90RZcmqXbMI UdgauEXc9/Yf4PwZ0gUNb7orJgJo6WEYSzCx93oSS+dNBFtHWFZaV0bEuc6ptfI6 Jq2Rxyn3vAuRcNCe1KxpQNTL2q5g7q8pPYD1YlFeZ+4z8kEIvdSkQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrieeggddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehorhhishcu uehurhhkohhvuceosghorhhishessghurhdrihhoqeenucggtffrrghtthgvrhhnpeehud evleekieetleevieeuhfduhedtiefgheekfeefgeelvdeuveeggfduueevfeenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsohhrihhssegsuh hrrdhioh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 11 Feb 2022 17:56:13 -0500 (EST) Date: Fri, 11 Feb 2022 14:56:12 -0800 From: Boris Burkov To: Josef Bacik Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 7/8] btrfs: do not try to repair bio that has no mirror set Message-ID: References: <531eb09d460d686e75e96f0ebafde78c670d84fe.1644532798.git.josef@toxicpanda.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <531eb09d460d686e75e96f0ebafde78c670d84fe.1644532798.git.josef@toxicpanda.com> Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Thu, Feb 10, 2022 at 05:44:25PM -0500, Josef Bacik wrote: > If we fail to submit a bio for whatever reason, we may not have setup a > mirror_num for that bio. This means we shouldn't try to do the repair > workflow, if we do we'll hit an BUG_ON(!failrec->this_mirror) in > clean_io_failure. Instead simply skip the repair workflow if we have no > mirror set, and add an assert to btrfs_check_repairable() to make it > easier to catch what is happening in the future. > > Signed-off-by: Josef Bacik Reviewed-by: Boris Burkov > --- > fs/btrfs/extent_io.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c > index bda7fa8cf540..29ffb2814e5c 100644 > --- a/fs/btrfs/extent_io.c > +++ b/fs/btrfs/extent_io.c > @@ -2610,6 +2610,7 @@ static bool btrfs_check_repairable(struct inode *inode, > * a good copy of the failed sector and if we succeed, we have setup > * everything for repair_io_failure to do the rest for us. > */ > + ASSERT(failed_mirror); > failrec->failed_mirror = failed_mirror; > failrec->this_mirror++; > if (failrec->this_mirror == failed_mirror) > @@ -3067,6 +3068,14 @@ static void end_bio_extent_readpage(struct bio *bio) > goto readpage_ok; > > if (is_data_inode(inode)) { > + /* > + * If we failed to submit the IO at all we'll have a > + * mirror_num == 0, in which case we need to just mark > + * the page with an error and unlock it and carry on. > + */ > + if (mirror == 0) > + goto readpage_ok; > + > /* > * btrfs_submit_read_repair() will handle all the good > * and bad sectors, we just continue to the next bvec. > -- > 2.26.3 >