Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1740090iog; Thu, 16 Jun 2022 12:47:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tzd6YcX1x7igJDj5avsuLKQP2f//Y+rw98CLcLG/q65pfz9Z34qSAh3pYlxzaeFivr49Yl X-Received: by 2002:a05:6402:2741:b0:434:fe8a:1f96 with SMTP id z1-20020a056402274100b00434fe8a1f96mr8407946edd.331.1655408873079; Thu, 16 Jun 2022 12:47:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655408873; cv=none; d=google.com; s=arc-20160816; b=MyT3GFzCQzaKB3OO6ybZq4zSO4aMXwn3RSN53TVdVNxd5wRKAe4V7u+7Ui7hxz6YVk F96gx2rki8dBDT0tKqLCyET88QjfVD33+/8hY+3kKFbiFbVmluUlD5lVNCeVnNaGW3/m YxfqgmxWOgczg7i0nKVFnpOfjVx9u6C/S+Zsmhj/HWlKtIH9jA1YcXwZ/Vjs6C5mOEzf /ynlpiwXgE5XssckfaDBMmagGPc9kRc4V6ON1TkdPdPnFie2FxIjKF8qX7bK8pQGbQLb Xh0TP2qvmnU4S0rSexxWTjnpa0EGH76ocjR1s8L4d9RRXhZeEJQt5X7ydptXorTsHMqI SsnA== 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=OV1YTRm+v7AUkPS1d6z+GKLa8H4BrPMSMgto9jS50pY=; b=w1RRpyFxQ05qJ9c1W13QX1lUZG+w6AFSQAtBWV/yVT3nV0DUrJWwermVne8RaqyB+b AKFlPI3ZEcN5Cmml/6KoIkm69fnxmfayOdMZmqUjA7T5xEj+8cekXIrDo0uwT0a1suKZ 2+aVlHoc3ishbz7H51fPmQ+Z7YROk/D8BsJ69wrOhTrW1BlCVYaQq1Z77hWtZlKuh/KV nAoR8ozBSDjqmxmNWEdVVAirOrvpu5rJVdfVBq8F0uWRlvQf5bdLeA1vmMFrT6FG4hFo GyDpaqnrri8ckSVTharfa7gnls8Sqcfv/KmzBYgHgOdjA+Ai49Y4E4ih4qG+KRyIPt70 tOqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=lBv63xbG; 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 hz5-20020a1709072ce500b006fedcc0e599si2397804ejc.118.2022.06.16.12.47.27; Thu, 16 Jun 2022 12:47:53 -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=lBv63xbG; 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 S1378055AbiFPTT5 (ORCPT + 99 others); Thu, 16 Jun 2022 15:19:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229898AbiFPTTz (ORCPT ); Thu, 16 Jun 2022 15:19:55 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 284EC562D2; Thu, 16 Jun 2022 12:19:52 -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=OV1YTRm+v7AUkPS1d6z+GKLa8H4BrPMSMgto9jS50pY=; b=lBv63xbGNVy2/GfvH8Ajklh1w9 hQewm7t/Z4fxTZIr6h06gKkCdcNrtyXfBPCK5Sr7Irj8yWZuGFHwbvhiPlbqCQ7Gm9QqyCePGgXBK VBjRMeAQvCJ3QaCMFIjvIiR8Lf2issUZpUhyhfhwWfKhtzuZ+j1DtwkDKL+DBIWBjiCJ1nqCg8F4W fjuuFVFnVmGANe/xSzLS5WDfAix4hlCcCnTnJ9BFuElINI/wTHKBs+b/ZRmyDf/M7U25wTNkp+GuU Mpg8hXAcJsx5m4nQraxLJU+A5/QS7cWOhZqQlcnp1DBr+QNFxZKquPV1etYxngfOBJ0oFWKE0XCbL KCkkSIZA==; 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 1o1v1y-0092ij-51; Thu, 16 Jun 2022 13:19:50 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1o1v1u-0006F7-UR; Thu, 16 Jun 2022 13:19:46 -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 Date: Thu, 16 Jun 2022 13:19:31 -0600 Message-Id: <20220616191945.23935-2-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 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 01/15] md/raid5: Make logic blocking check consistent with logic that blocks 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 check in raid5_make_request differs very slightly from the logic that causes it to block lower down. This likely does not cause a bug as the check is fuzzy anyway (as reshape may move on between the first check and the subsequent check). However, make it consistent so it can be cleaned up in a subsequent patch. The condition which causes the schedule is: !(mddev->reshape_backwards ? logical_sector < conf->reshape_progress : logical_sector >= conf->reshape_progress) && (mddev->reshape_backwards ? logical_sector < conf->reshape_safe : logical_sector >= conf->reshape_safe) The condition that causes the early bailout is made to match this. Signed-off-by: Logan Gunthorpe --- drivers/md/raid5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 5d84bad8b854..b3d1f894f154 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -5841,7 +5841,7 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi) if ((bi->bi_opf & REQ_NOWAIT) && (conf->reshape_progress != MaxSector) && (mddev->reshape_backwards - ? (logical_sector > conf->reshape_progress && logical_sector <= conf->reshape_safe) + ? (logical_sector >= conf->reshape_progress && logical_sector < conf->reshape_safe) : (logical_sector >= conf->reshape_safe && logical_sector < conf->reshape_progress))) { bio_wouldblock_error(bi); if (rw == WRITE) -- 2.30.2