Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4754305ioa; Wed, 27 Apr 2022 10:20:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjs4cAzpVkQHXwKzueeY4LJZvWtU1uLZzUnPatAKQ0SBoNSVAQZwfzNp5juiZ8i0ggWNrP X-Received: by 2002:a17:902:9349:b0:158:a6f7:e280 with SMTP id g9-20020a170902934900b00158a6f7e280mr29385957plp.155.1651080015626; Wed, 27 Apr 2022 10:20:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651080015; cv=none; d=google.com; s=arc-20160816; b=YmacC8qkSciDGgVGcoJLq515nvPtrCD7Tcw0FqXPWK1JYtgp7KaNw5J9KD8oEl+fLA B0sXyOfkyJwHXrdvFTU2IsU15pj0hCJkLhMuLM74JnvfSrzbFzXO5E2nU29VgTLkX4yj +ZuxOePDcsfItsAONTEFYjJCx1QKqxt664bVFCXxWU2bm0dSeNjZcKq4qkihcxlacIVC tmwXHxD3UXUvGjFiOr5EZoef3Ld2C2tohfz5jSFzvzeSdqG0H8cm7G72mLcWBi7i9yAK IIpwOyYPeKGE9gDw76IqmmJyLsF6xNRpUrjZPCKIf/yXJ14HlA+g1qBHPb9XOVFufOQ5 CmtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:in-reply-to :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=qPV3GAutYS1USEKN2DLYVcHIf/3CMspob9f64O94K9s=; b=MlvWxW9m2o5JWzbEjQMb2ywv5rduHwlZ5ep0w/nqpl8e3+I1qT2eH9xMOIdJl8opgw tjesDwj5bsM0agTTQygiQH6VugC03HRRdFs1LDt9IdoV6xHC+68CpfExnGZ6chKv7487 Pfn56WPVt9yvl3RmeYu2yQNTkG7zuByHktzmBGNhuiDLgK9jn0EU5op1ZgvVZdRgUucL Xf4WpCwJud7++qXL3CfZ+hXI2E1aZPz04lvI07WvV9UqvYdHUvMoZ9wGFeN3xMFVOsyr aoKAz4AFt3fsY3SW2/TLUJCa6L5xENCgOZsmggxYQBr4oP+y9jO4y64EES6XCB2q+6f9 8Ywg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=tYsy3EBG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ju10-20020a17090b20ca00b001d285255f40si5995271pjb.32.2022.04.27.10.20.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 10:20:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=tYsy3EBG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 469A9490547; Wed, 27 Apr 2022 09:52:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243494AbiD0QzH (ORCPT + 99 others); Wed, 27 Apr 2022 12:55:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243396AbiD0QzF (ORCPT ); Wed, 27 Apr 2022 12:55:05 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9DD3480C92; Wed, 27 Apr 2022 09:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:From:References:Cc:To: MIME-Version:Date:Message-ID:content-disposition; bh=qPV3GAutYS1USEKN2DLYVcHIf/3CMspob9f64O94K9s=; b=tYsy3EBGWgOHTFK2epLpskbkim NoLL0yo6mR70L1KzhaQ3sM3DHIifX2jjI56LneTbkuYwPZUYrn7bIWLQ9UA2prF5NPNxANy3QK4dN IZ2WXIaJfOrzQ/FqFc0ziPv3iInuIn1I3BIgR2KppRk4tCywZWla/Mb3lxeqs14PhddwQ88fJ0UST Q85sKcJKFFY727t1MxzB0XKn5DaoDV2LF0y2sQXfzpptFEFj+63y3edwfw4fe0eZjm/ORTXQZxFQV eB/Q3I9W0DiZXP4ogozcnYUZ1kGbDaCyP5Fc1QSAiQkESqy9CJpiRGXSD3BIwVWtMJaeO6pBJcVey Yv/BJnbw==; Received: from s0106ac1f6bb1ecac.cg.shawcable.net ([70.73.163.230] helo=[192.168.11.155]) by ale.deltatee.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1njkDE-000K8u-Lb; Wed, 27 Apr 2022 10:08:21 -0600 Message-ID: <7db3cc87-c491-1ba4-d778-1c7dbbf34c47@deltatee.com> Date: Wed, 27 Apr 2022 10:08:20 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US To: Guoqing Jiang , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu Cc: Christoph Hellwig , Stephen Bates , Martin Oliveira , David Sloan References: <20220420195425.34911-1-logang@deltatee.com> <20220420195425.34911-3-logang@deltatee.com> From: Logan Gunthorpe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 70.73.163.230 X-SA-Exim-Rcpt-To: guoqing.jiang@linux.dev, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, song@kernel.org, hch@infradead.org, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 Subject: Re: [PATCH v2 02/12] md/raid5: Refactor raid5_make_request loop X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-04-26 19:32, Guoqing Jiang wrote: > > > On 4/21/22 3:54 AM, Logan Gunthorpe wrote: >> Break immediately if raid5_get_active_stripe() returns NULL and deindent >> the rest of the loop. Annotate this check with an unlikely(). >> >> This makes the code easier to read and reduces the indentation level. >> >> No functional changes intended. >> >> Signed-off-by: Logan Gunthorpe >> --- >>   drivers/md/raid5.c | 109 +++++++++++++++++++++++---------------------- >>   1 file changed, 55 insertions(+), 54 deletions(-) >> >> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c >> index 97b23c18402b..cda6857e6207 100644 >> --- a/drivers/md/raid5.c >> +++ b/drivers/md/raid5.c >> @@ -5906,68 +5906,69 @@ static bool raid5_make_request(struct mddev >> *mddev, struct bio * bi) > > ... > >> +        if (unlikely(!sh)) { >> +            /* cannot get stripe, just give-up */ >> +            bi->bi_status = BLK_STS_IOERR; >> +            break; >> +        } > > > Nit, I would suggest to keep below original comment. But the original comment was plainly wrong... Logan