Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4725926ioa; Wed, 27 Apr 2022 09:45:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwY0I5X3GUfpU99LB3GS1kgom1cc4MmBB9Y3A1R6AY5+K025+dCQ7TRiLrSEL5+bLaqODWd X-Received: by 2002:a17:902:ce85:b0:15d:1f31:8e75 with SMTP id f5-20020a170902ce8500b0015d1f318e75mr14093408plg.41.1651077917754; Wed, 27 Apr 2022 09:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651077917; cv=none; d=google.com; s=arc-20160816; b=MvXheXz4F7fZMpT4rVoQ7H6Cgzbzth0gZNI+mHbY90GKIjCESRXZuQdtxrNukTJMe9 6Ap7FF1PyI4UPlK2Fu1BkMrb5Xxu5dsYS+9SG+iu/1cpYGsuJJov+IeHYSzSUrhnTIQI 0+54oRgjasQFm4e/4FFo9KIbXLkgDjWbIuRhN1n9JVflEjVwKBHraYb/+ZyqXIsS0qoG aGPHHKUvZ250lll6w6qvM+tyoVug2AjZ4tCPcjMZLHdqAqkSKGUx7hupd033CQOQihLO u5XOJNr/uVh96Jlt8yorV/YBZT6f/17btu89ob3fQE5JUED6GA2b+vhQ4BFiMZ2EFdZ8 0mcA== 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:in-reply-to :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=gRRhOj8clhoH6+uFPZPq6FKVuwIU2733V3ei3eBIRbg=; b=agE+qIWCM2PXvBffvlod6tTD+E4fl19wF+pDHpTxHY+BncBSXQRBaELuql7zuurC7p d/QYK3blpfc+dWQ+a1PowT983v1S00LZQ9X1juaw2vc/BSWW3vSMS/+Btmnj0kj+34Vm ir1P+9dbYNzVU7Z88fOHY6ECnt08B8FE0U19SzDqKs8xhHXgJ3o2LHZzeBfLHysIrTnw MuVdHjdudo8H63wbg5ciBL3aYdTyKos7VNcDxk0ZxYYBrqGZzKP/Z8q+ezRcefxMH9Oy Q8fsbrQ/ReTJILxQKMueoDDo+2SMf29A5VwWcqijuqhhKbLLx+Q8HqcO0GEgST76k7G2 40RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=Oq819TCD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i15-20020aa78d8f000000b0050abab7d9a4si1719698pfr.321.2022.04.27.09.45.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 09:45:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=Oq819TCD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DC5A01E1DC7; Wed, 27 Apr 2022 09:15:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241649AbiD0QRp (ORCPT + 99 others); Wed, 27 Apr 2022 12:17:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243980AbiD0QPo (ORCPT ); Wed, 27 Apr 2022 12:15:44 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9C7345AAB8; Wed, 27 Apr 2022 09:12:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:From:References:Cc:To: MIME-Version:Date:Message-ID:content-disposition; bh=gRRhOj8clhoH6+uFPZPq6FKVuwIU2733V3ei3eBIRbg=; b=Oq819TCDeE6yL49nBZVyUsKifS aA4DAOIzEvh8tNIfGAThXAwWn/6NCXpzPFH0BJmHsXT+RGIxV3R+Zz2kSyG9kcTM+nYg/9cAtBQnQ Iyb8GTTxHJlwDqLO8fxgTawTJJc1fFttGgX8QV+eWVsDsy+SbClTkmOzd064qMqG9x4ZFpa1IW/GS Y8CoOz9ZhU0CfLLmHVQyk0cvs42TjS7vM0k0Lm/66hxsj3rTiCsSzExqiME1LCJGDNuw7x5awL5hQ e8B6Y8NAdGV/XB+Rd/C1bmLwAIUQCd8ia9/R8JGeMM5uxEStuolnpIHBlpm6kCro5ceJ6WnJ+1lZo YnQzoXmQ==; Received: from s0106ac1f6bb1ecac.cg.shawcable.net ([70.73.163.230] helo=[192.168.11.155]) by ale.deltatee.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1njkG2-000KCB-1s; Wed, 27 Apr 2022 10:11:14 -0600 Message-ID: <78b4b92f-ae89-2e54-f96f-21d338ca042b@deltatee.com> Date: Wed, 27 Apr 2022 10:11:13 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US To: Guoqing Jiang , 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-12-logang@deltatee.com> <7f61aacd-d378-092c-1291-f2aaf42a5537@linux.dev> From: Logan Gunthorpe In-Reply-To: <7f61aacd-d378-092c-1291-f2aaf42a5537@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 70.73.163.230 X-SA-Exim-Rcpt-To: guoqing.jiang@linux.dev, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, song@kernel.org, hch@infradead.org, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com X-SA-Exim-Mail-From: logang@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=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 Subject: Re: [PATCH v2 11/12] md/raid5: Check all disks in a stripe_head for reshape progress 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 On 2022-04-26 19:53, Guoqing Jiang wrote: >> +static bool stripe_ahead_of_reshape(struct mddev *mddev, struct >> r5conf *conf, >> +                    struct stripe_head *sh) >> +{ >> +    sector_t max_sector = 0, min_sector = MaxSector; >> +    bool ret = false; >> +    int dd_idx; >> + >> +    for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) { >> +        if (dd_idx == sh->pd_idx) >> +            continue; >> + >> +        min_sector = min(min_sector, sh->dev[dd_idx].sector); >> +        max_sector = min(max_sector, sh->dev[dd_idx].sector); >> +    } >> + >> +    spin_lock_irq(&conf->device_lock); >> + >> +    if (!range_ahead_of_reshape(mddev, min_sector, max_sector, >> +                     conf->reshape_progress)) >> +        /* mismatch, need to try again */ >> +        ret = true; > > I think we can just open code range_ahead_of_reshape. I think this way is much easier to read. GCC is much > And seems the above is not same as below original checking which compare > logical_sector with reshape_progress. Is it intentional or am I miss > something? Yes, this was intentional, the change is necessary for the next patch to ensure that all pages in a stripe are ahead of the reshape. This was not intended as just a cleanup patch. Logan