Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4388932ioa; Wed, 27 Apr 2022 02:45:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqfppnI2Fi7COW6Yl+Xc9WK8SLFEGr/qAS0tJZOaVZFsr5nHo79ZXVvNzFQ9eBti/iT5Zn X-Received: by 2002:a17:902:70c1:b0:156:16c0:dc7b with SMTP id l1-20020a17090270c100b0015616c0dc7bmr27903523plt.85.1651052702305; Wed, 27 Apr 2022 02:45:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651052702; cv=none; d=google.com; s=arc-20160816; b=keAJ2DthgALcg/6Ad5iXb2Ox3Y4KN4hW8sV6nTc0mgzzMly77K6RNdccTr1PUSFd2H Nh/EpaKXZiM0lOoRgqWmH4ma229mPcdlu1TPSmNI8T+FQSTlXpRASMV3J49MDqJH6b7h 0CEDZSXCGm7J9lcaa+qSMqQkpHgIZIqVJPy6hOdWBMQVL+Kl8T8WKUtzPaS4fDdCDbTl RonKEIE3dnbcmoJSyodiRlvvgluR36OyFZwMV6sOnTQlJX7/CHD8vUorxYz4l4aBifNt l7Y2A/UncxADdq32+HGjEosh3kwQjWK4gJrhCjkwSP4zLvz2FdzVfWFiBGKzWgXBCSIF eDiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:date:message-id:references:cc:to:subject :from:dkim-signature; bh=DNundTitWrjHN9Al1s781albF2X/onqhV3Sz2DqMeZ8=; b=Fe6i1jXYytFVEnoW1/6A/l7WG6mwvhTTj5fbdm99yN/QIotDlOnEwoBaZt5+GSi5E7 O96+NIVp+rW3JB6bQsfieVI2dhETD39EC1Oiy5JhBiDFrVDqBVVrwqY+tBu2/L8gWbfR 9Mp01IAq+MGH5BgQKdjtMTv38m/H8k511QxTxdTWVRcP7dRtS0kMdPoIvb8d28DnuK7W DRKJR8LoynNaNMXbiFpgpwXnFJyLsSSjBhyaqrvqDqCpkKS1HdN1pL1gTE803IBRLtW2 TaxTAVSuNfw5otlFs6eWEUhsTtZfm/kRawEiA67bKUsfuOJaPFWOlirFPlJx8VAt/32A IF1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YRuf7WFt; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u33-20020a631421000000b003a9f9442c80si974478pgl.508.2022.04.27.02.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 02:45:02 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YRuf7WFt; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2196D284D9B; Wed, 27 Apr 2022 02:19:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356733AbiD0Bff (ORCPT + 99 others); Tue, 26 Apr 2022 21:35:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354729AbiD0Bfd (ORCPT ); Tue, 26 Apr 2022 21:35:33 -0400 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 586C946B27; Tue, 26 Apr 2022 18:32:24 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1651023142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DNundTitWrjHN9Al1s781albF2X/onqhV3Sz2DqMeZ8=; b=YRuf7WFtBwyQD9Ur4tUSqUSlzlK+bNkQoYqtV/wA8/auIQOmAgv4i+q8dni/impRbC/NPq Rggz+YEbEShz745x3N5mFgfrEd54UBrXZ+2Df+S551AXmMXVnVWcBk0mSo6HRurKz3EMHO kO2J1mik2kU9GoL2u5QFJC+U3kKpYJQ= From: Guoqing Jiang Subject: Re: [PATCH v2 02/12] md/raid5: Refactor raid5_make_request loop To: Logan Gunthorpe , 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> Message-ID: Date: Wed, 27 Apr 2022 09:32:14 +0800 MIME-Version: 1.0 In-Reply-To: <20220420195425.34911-3-logang@deltatee.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > - /* cannot get stripe for read-ahead, just give-up */ > - bi->bi_status = BLK_STS_IOERR; > - break; Anyway. Reviewed-by: Guoqing Jiang Thanks, Guoqing