Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3395313rwa; Tue, 23 Aug 2022 04:11:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR5BMlC1MXruwFPCsz2DuPAuBojADpkUqERD9H9jbjtiT8ka21jnss2P6lNvTxLZ+1d/4Mx3 X-Received: by 2002:a63:4f10:0:b0:426:9c61:5e48 with SMTP id d16-20020a634f10000000b004269c615e48mr19999394pgb.360.1661253087906; Tue, 23 Aug 2022 04:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253087; cv=none; d=google.com; s=arc-20160816; b=y+d6SOwYqjvfDknd8V6qU3s4bUkEmlYj8K1cBS9xVB440gzVZlxHm5EV44APoGLX3H HtrlneCietk3jLx129+/ChgsmO9Gd6MNb9kEeA1XWJBROEb0BY/8vVVjgwH/rqjm2FZX 3omryNqrIuKANNqQEu8VxjooBnOrSR2cBhGVRyzmN8YRNPhA9Jn0ACEZEd/dLhtlzKb+ TrdehyF3WW8ZQJWFA5Snsn/6EFIeeSgQ2zZ16IKtg+WTI9Q49WmKQVDrSckWa0xjl8Ty s3If1pqDl/PBGW1SxxLNOp2KYhpcnM8E0I19KKsOmAfEGRviBarNYoViF7GYa4mSqKhZ u2Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zrdn30PYA16/3QQGXcZvtLewcYJx46i6HsFTZCAllWs=; b=HD6EVLjMjhTXf+LyilYkxSKj5svWZnI8dcPNchgkiC0F2QufaMq6Rqrts4hbr0K3QB dYFAFQdEO5JEaeCtyLUHX5jP7rk3Yfc0SxUrlhB3U5uxBsb0zbMnI6WHOvCYVDvguyPq W8wkZEQ4nX91xpyc6od49g/R/5fin0CGTN3yGPf4H10jW1Un6njt2oImRfpPpFgUy6qi EAp361YJVZxQbDPvMrWaBrnrs+UM1e8gWbHzZ9TGkq5vSzqHcRIlipi42OC0yRb20BRb 76IfemgFesHAd1bCF+yo2cqGCn3vv4KsxYWuRHvPZq8LqcPRCsKRk2fX8lGiVlKjdsYb ae/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XU4tSjRE; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a056a00194a00b005371bb2846esi191041pfk.341.2022.08.23.04.11.16; Tue, 23 Aug 2022 04:11:27 -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=@linuxfoundation.org header.s=korg header.b=XU4tSjRE; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235782AbiHWJSZ (ORCPT + 99 others); Tue, 23 Aug 2022 05:18:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349601AbiHWJQH (ORCPT ); Tue, 23 Aug 2022 05:16:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94A267539B; Tue, 23 Aug 2022 01:32:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 25184614C2; Tue, 23 Aug 2022 08:32:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A5E6C43140; Tue, 23 Aug 2022 08:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243548; bh=gm4JWmFIYfwLgfO8bC1MN2J9LdWEiHeJg2NX56k84FU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XU4tSjREz96PFMwsO6RSfe5Dm2mcG5Z7QYGBf4s38+zzriYPlbW8eHUx3wiDDxaFV t1FuK19dpj0nFC1AESNDe/78VBha6gx7yUVqkMnbiu36+NPOTj5kkjP7QyyPRh/wF4 FUPnjtq96XhmSAAXNcVCUpnwmKjaaS8pLn5yZEPc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Logan Gunthorpe , Song Liu , Jens Axboe , Sasha Levin Subject: [PATCH 5.19 312/365] md/raid5: Make logic blocking check consistent with logic that blocks Date: Tue, 23 Aug 2022 10:03:33 +0200 Message-Id: <20220823080131.232792593@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Logan Gunthorpe [ Upstream commit 6e3f50d30af847bebce072182bd735e90a294c6a ] 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 Signed-off-by: Song Liu Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- 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 c8539d0e12dd..45482cebacdb 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.35.1