Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1731235iog; Thu, 16 Jun 2022 12:33:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uTGHo/IImQtp5pw9JL+N+mS/EyfeD1bhkRNG0XahrSuqroYYHMZl7WKJWkiDNkJMI+hbyt X-Received: by 2002:a05:6402:1d51:b0:41f:cf6c:35a5 with SMTP id dz17-20020a0564021d5100b0041fcf6c35a5mr8431980edb.25.1655408025377; Thu, 16 Jun 2022 12:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655408025; cv=none; d=google.com; s=arc-20160816; b=ZDXJpnAapBHoK/DnQroWlt1gWTxeQKsdB6Y+Yhkm15EoofehxYuzOX8C9yhodnaTxn gU7Whq0RrG2Dd9cTs5lrZE0kVF2XARL4Y1Uw2OyRAYetNMYh+cFXle4OOKSE6J8I5hP1 FRcxs1e8XbeAWiWJI5EHby+vYnFEFl7pbIFJHvGZiQHfhaW0KbbbspAJWOut+RbJRjRE 2ncaq947Ldkb0PBGetHyzG0vcAfbWKL67Lnb01rtstcoxm3znuINjaLmU2vPZw31807j aX6geR7f3T68wFvk31rdNqDDtiGb7nJz35ihg6U+UxDdI9l8dBr4nPDUy1cI+lfpOisC wisw== 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:mime-version :references:in-reply-to:message-id:date:cc:to:from:dkim-signature; bh=TqznKfD7muouxLbcabxY3rl2UiNCi1GG48QLUynPBk8=; b=s17ZHKXlXsRT2nQhfk8YjYghCHOcy3+UEL0ASjJyH9ABb6UrKrfLsFaMy32YbXQ/+j kQh2M3h6QAUeKBR6f0T7B3b1eYI0mjuX+9Dt9gn5z7mk71+mwQEleArCIuEEARPpWTKA kXnC91i5pUpzgYx34PS+wTCp0z5hxwtsx1YsGlf0CluToJrmGf2b74zjvS6IT8XNfQ7k 85RkZXsxGfuxMsBC3LTOzenKoEg/JPL0yZg59Dz2SNM2JGOXmWWiuXlmdRwN4UG5aDOp 7wWFZkXCITYSXMjpr2swvQJjHwBXdbGRV/LTp6kKoA/XCtfzxwHankRfRxIN7hrHz0UV h33A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=TtqiVFP3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc26-20020a1709071c1a00b00711fa454faesi2464582ejc.997.2022.06.16.12.33.19; Thu, 16 Jun 2022 12:33:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=TtqiVFP3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378274AbiFPTUT (ORCPT + 99 others); Thu, 16 Jun 2022 15:20:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347063AbiFPTT4 (ORCPT ); Thu, 16 Jun 2022 15:19:56 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EC95554BB; Thu, 16 Jun 2022 12:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=TqznKfD7muouxLbcabxY3rl2UiNCi1GG48QLUynPBk8=; b=TtqiVFP3QPkvf5CnjXYEln8JuL 1UqOuOCt/ntx4DInt92dOdN9bp7T/FnGUqN9AXMVMACp5GbxXJjd1Ew454rA6h80MbAd1T1Hj0Tpt GRBgcRnpYhnhYNak1x6AJ8qXO9XsNAwy26J5AstpVhsBulUTuYKNtb2XsSHHAqeLQd8GJlkURCdbh fGyg9v8rgvSlk3dZEzcCrTuQl1ydO70erknUx0yYFaM6capagHKS4N90/QT2gpuZU99vG2OFmCybq hoOdqn5di2+SCCw0fLaknSRBWc8xuz7skfPB79KHuevlBbE82/WqJZ0f8Rbx3wIJntydFKvdyiB3L JkQ1xdQA==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1o1v20-0092il-0m; Thu, 16 Jun 2022 13:19:52 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1o1v1w-0006FY-1Q; Thu, 16 Jun 2022 13:19:48 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu Cc: Christoph Hellwig , Guoqing Jiang , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe , Christoph Hellwig Date: Thu, 16 Jun 2022 13:19:39 -0600 Message-Id: <20220616191945.23935-10-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220616191945.23935-1-logang@deltatee.com> References: <20220616191945.23935-1-logang@deltatee.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, song@kernel.org, hch@infradead.org, guoqing.jiang@linux.dev, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com, hch@lst.de X-SA-Exim-Mail-From: gunthorp@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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v3 09/15] md/raid5: Refactor for loop in raid5_make_request() into while 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 The for loop with retry label can be more cleanly expressed as a while loop by moving the logical_sector increment into the success path. No functional changes intended. Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig --- drivers/md/raid5.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 345350d34623..17ddaa41147c 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -5974,22 +5974,23 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi) } md_account_bio(mddev, &bi); prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE); - for (; logical_sector < last_sector; logical_sector += RAID5_STRIPE_SECTORS(conf)) { - retry: + while (logical_sector < last_sector) { res = make_stripe_request(mddev, conf, &ctx, logical_sector, bi); if (res == STRIPE_FAIL) break; if (res == STRIPE_RETRY) - goto retry; + continue; if (res == STRIPE_SCHEDULE_AND_RETRY) { schedule(); prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE); - goto retry; + continue; } + + logical_sector += RAID5_STRIPE_SECTORS(conf); } finish_wait(&conf->wait_for_overlap, &w); -- 2.30.2