Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp597135lfu; Thu, 7 Apr 2022 11:32:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdmVJwOUhGW3ggb4fAtoqDkYfwLxJ0Ld5t25UefPHJ6yZqdO87d4+xCQP44Qq6JBOmhWh4 X-Received: by 2002:a05:6402:35d4:b0:419:64e3:4ad1 with SMTP id z20-20020a05640235d400b0041964e34ad1mr15779972edc.260.1649356372159; Thu, 07 Apr 2022 11:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649356372; cv=none; d=google.com; s=arc-20160816; b=cu8hr+esu+iaQRTW7jAoVnl50xpgfTdhiNOs9KPC5Cm8V6RT+McOssF1uVEb8XZLQk IwDkq2ToC38n/bC+WrPFzPg6U/u4ZeO2RGZtDIEwXb86U10mVGmUq8kHmBRd3oNHhABl Q6uGlXN0wgq98h7K+1eceFrdiVYwTxTe+Bw0azwcyx0W+Sezdj6+We/ECgM+DSebqKyA 9JqhogmRdTy+pD720Pic013n/97ThSIlNGWJYAqCBkbPIjnFi0T8JplTKrBVfVYxb+yG Xe33GmyAwhe1Cnj7CTnqTIZAWr+6FqMjE+1kpK967tkjbX9x+ernFjGieO0q6zm6kDe1 DQfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YSea+azCLlVibk6WtN+bQC5ZLuefUNq1U9p8LGAsefw=; b=MNFRroRONg0jJB/J9WzSOINw6Qu9ojtwwIPz/N7w/5+J61xwCLwYL8MR0edzzVq8eA 3uoTfeaLMqwYlhywkBfv7AakA8NjUEaOrqwwXmRANubPB9Q62Jyto1xc61fBwSWFoUF/ UnFv8FhNgmjZoKXmeSVgDnLTWWHTILGQMYmoQw+Dq6eEOwU6PwTPmhSCP3pJ1FrpoLT+ Ue3gw1vkYbjEGErfrW4Qi50h/LEL5Jqn7buiHMlRhufE2tDOvLsu+zdaQGfdBDXB4PuW /Ucz6He5UMiuFKeLmbMjh1SzAHL276UhJqfLfl09FkKtAsiZDGX74K7sGldIsPjQGmzI efRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=s5JoQXtZ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a170906654500b006e7f5df27besi10935747ejn.870.2022.04.07.11.32.25; Thu, 07 Apr 2022 11:32:52 -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=@infradead.org header.s=bombadil.20210309 header.b=s5JoQXtZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231360AbiDGINe (ORCPT + 99 others); Thu, 7 Apr 2022 04:13:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232766AbiDGINN (ORCPT ); Thu, 7 Apr 2022 04:13:13 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 550673FD9E; Thu, 7 Apr 2022 01:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YSea+azCLlVibk6WtN+bQC5ZLuefUNq1U9p8LGAsefw=; b=s5JoQXtZ0ZBfVVwo8YuDOdZXfo ZTf1iTaiLB6l8SU7IQiVOaxjyuZSMWy3wvU2rCDLUQDWnyKVA/j3CHn4s/7ak3kZTsLew1/DMQK3p 6+czEMANzRDZjFuvPhsIXwUgGLkK42flhsMUBsU7WJ9JtoF3sDJL2y+aqyTxwJTx65xEigyVg4yGf vxUIGanMEgiGtiU0d3JREEJm1heHIWdXMODkG7zqKl4A/VMcV3hoFR7Cz7Cwo8X7HpK3xkmjoiCXR 4KsMWOeBb9Wq7n1JoaeJcyyv6L+lo9O0cFbBeL1Qe0Nxzn55iE+UxCPo2Ne/MWMYvGEzRFjEClaqA 5uTqFh+A==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncNET-00AGuj-7k; Thu, 07 Apr 2022 08:11:09 +0000 Date: Thu, 7 Apr 2022 01:11:09 -0700 From: Christoph Hellwig To: "Yuezhang.Mo@sony.com" Cc: Christoph Hellwig , Namjae Jeon , "sj1557.seo@samsung.com" , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" , "axboe@kernel.dk" Subject: Re: [PATCH v2 1/2] block: add sync_blockdev_range() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Wed, Apr 06, 2022 at 10:21:15AM +0000, Yuezhang.Mo@sony.com wrote: > > From: Christoph Hellwig > > > --- a/block/bdev.c > > > +++ b/block/bdev.c > > > @@ -200,6 +200,16 @@ int sync_blockdev(struct block_device *bdev) } > > > EXPORT_SYMBOL(sync_blockdev); > > > > > > +int sync_blockdev_range(struct block_device *bdev, loff_t lstart, > > > +loff_t lend) { > > > + if (!bdev) > > > + return 0; > > > > This check isn't really needed, and I don't think we need a !CONFIG_BLOCK > > stub for this either. > > sync_blockdev() and related helpers have this check and a !CONFIG_BLOCK stub. > I would like to understand the background of your comment, could you explain a little more? sync_blockdev and sync_blockdev do that because they are unconditionally called from sync_filesystem, and not just from block-dependent code. Eventually that should be cleaned up as well, but please don't add it to new code.