Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp471055lqb; Wed, 29 May 2024 00:44:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDyal09QY1RJYkWSYdh8u1GzPy+WEWR75HGg2dd1OOSnvBKBVdq0bojhCwzkt3jadAfP921JX1pzwHGLbyFPOQL1Bos7sRyUdhp+kvZQ== X-Google-Smtp-Source: AGHT+IEZSNDCBhyD2OOHZgi/sgm8UDV4CZjfxsk1gKfG18txGwI5KcL+70XFLe+D+V9uKHoCfxDS X-Received: by 2002:a05:6870:599:b0:23d:30fc:8e8f with SMTP id 586e51a60fabf-24ca13e6746mr15452577fac.36.1716968665346; Wed, 29 May 2024 00:44:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716968665; cv=pass; d=google.com; s=arc-20160816; b=y3r5Lr+4ax+x5Ezjz8gnOPDRAmpL7AcVBQFgE6lZJGXhHfD9J3sRwL0ldf2CI7wmDz og+3umJieT2x/0ahGwnb4GlFtw/Ip9PO8HQouFmf4NZjx5k/Uav7+wf1jhH2rmCt23yJ uUPbeBDjXyvRAgduRo83VHk9CXb0cYnJokKEb8vrEQjTW0+bKbUI+Y5eBDyOLmNvCyIv aUeDrzfvbS/MH6a8AeUjzPdsrB5yujCxHBGKsy7dUNF+9kzSINZ0XuUIj/J9kaJeSHCx oZCXb0kbEHMGWM3MfTe2RvX9LDQ0jKbiouIr8Qcj52w4bv0tYj7ghCfK2olxKJD//FR9 pYzg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XKugIXq2VCXINiWMPwdj+KJMB15h1t1nSqX785LINho=; fh=9Dy9sRET4/5DriHzqWcs7mlKdv8mifTOpIx4+2bmj8w=; b=ZHYXArKHp2EhXdQE2/Rvnjm2p/E84jSQxNPwMVGkuTEQ/ITuEriSxyU4yMQee+hTQm oeQpmhmZu9fX7wD0O9D9VhHkFDzybK0SRf+9HZhp+OT58hTlciCqFHkz7GzXUy8lcY1q 3RCxCA+3VFZsYeZ63LY0HSYBXzs0me9uBbcN8IyIrzc82XQoKeo3uQIGZg4ugsgikEii /umgHJXS2hjzD0P4nwWsi6r+rLrh/aL0XCReaWhx1jD+r2kG9aGyjM8F+ZBCivfcxhaF fg3GQgg0OSyt4wbgZbz1SmJ61Ms2zorW55fED7E8xTeU916o9Z6WdHQ2G2QgfgXJXAr4 gW+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=jLtctoLY; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-193474-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193474-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f8fd9dc616si9413357b3a.335.2024.05.29.00.44.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 00:44:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193474-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=jLtctoLY; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-193474-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193474-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C2FDCB26F58 for ; Wed, 29 May 2024 05:44:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05D3E15CD58; Wed, 29 May 2024 05:44:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="jLtctoLY" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B467C15B0EB; Wed, 29 May 2024 05:44:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716961449; cv=none; b=F8Ow45tZ6PRVrK2Rwj+XcnlZvseZXEkq+hjMhxctYYNGA21uw6ZTX/pxsL2LnB0wHDvtbR7uLS66mBwpigCGxXwnnWm07gVkz6356R2Gjq76qUdVrBeCHKCByZ7KTfOr1j1LV4b3DR7/LgL5tLlg/25bxs2H2d4Yjbpd4qsB+UA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716961449; c=relaxed/simple; bh=61bBAOGhuZ3r3CS7FR3rN5XM5g9Zeya/IIrNIcErpAk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dXToOlxqN0TaTrvvqqZP8kUIqQxfn+Xj2I0W5Hwk6gw5H7ewEcZfZ9doS0jvlKmqtYgybiydxWLjBzv6EGk4+RBMoBPf9aj2T/Y5F3HR7SUtGXMfB3N10VL/G5lQVIzbLtBRf+xncYWFPvOfHytvyWhaz7I5Rd0PzHZ/L3UNoss= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=jLtctoLY; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=XKugIXq2VCXINiWMPwdj+KJMB15h1t1nSqX785LINho=; b=jLtctoLYiSPJ3mejHLiy2yVfye +/inEfkytMkXlaKCizOVCxJ4Bh8VPuOkcAf193FC3nAy0E6bI1AJWikBy3wRg5Dy884iNGvoOwsKP qj1kubWaMWmUVvbrHPP71CmetZtvnTPffgNtMNUNXIqGmRD89BgeNudYAIOjG/CuKhjIiS8L6gBVi FdlEG5VyHA2WlbO4rc6U+dZN6KDrc+FB51vaeQmb85HCebke7O7HTxMmCiN3VB/luJKsi6WnjH9jM 46SjVgw7p7bzl4YIJUWW52aLDlHbkuBeZMHv7ZxFUO8WvMcIo61IzDSEafhUonCDoFWhd061Rt9hJ frcBEQGg==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCC6W-00000002vBs-02an; Wed, 29 May 2024 05:44:04 +0000 Date: Tue, 28 May 2024 22:44:03 -0700 From: Christoph Hellwig To: Li Nan Cc: Christoph Hellwig , song@kernel.org, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com Subject: Re: [PATCH v2] md: make md_flush_request() more readable Message-ID: References: <20240528203149.2383260-1-linan666@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Tue, May 28, 2024 at 09:49:44PM +0800, Li Nan wrote: > > > 在 2024/5/28 21:23, Christoph Hellwig 写道: > > Looks good: > > > > Reviewed-by: Christoph Hellwig > > > > . > As suggested by Kuai, I will use bio_sectors instead of bi_size in v3. > > - if (bio->bi_iter.bi_size == 0) { > + if (!bio_sectors(bio)) { That looks weird. bio_sectors literally just shifts bio->bi_iter.bi_size to be in units of sectors, which doesn't matter for comparing with 0.