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 AE325C433F5 for ; Wed, 27 Apr 2022 01:32:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356687AbiD0Bff (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-raid@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