From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2475DC433E6 for ; Wed, 17 Feb 2021 15:38:59 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F1C364D9A for ; Wed, 17 Feb 2021 15:38:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F1C364D9A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-535-HkcBRxUIOx2t_re1ijv3jQ-1; Wed, 17 Feb 2021 10:38:52 -0500 X-MC-Unique: HkcBRxUIOx2t_re1ijv3jQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E18680196C; Wed, 17 Feb 2021 15:38:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D09F2C169; Wed, 17 Feb 2021 15:38:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1CCA658074; Wed, 17 Feb 2021 15:38:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11GBkbEf028560 for ; Tue, 16 Feb 2021 06:46:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0E7C620614DB; Tue, 16 Feb 2021 11:46:37 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 096A520614D9 for ; Tue, 16 Feb 2021 11:46:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C9B82803FF9 for ; Tue, 16 Feb 2021 11:46:34 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-249-OjDyebdMOb-Pw_k9r1HZhg-1; Tue, 16 Feb 2021 06:46:28 -0500 X-MC-Unique: OjDyebdMOb-Pw_k9r1HZhg-1 Received: by verein.lst.de (Postfix, from userid 2407) id 5738667373; Tue, 16 Feb 2021 12:46:24 +0100 (CET) Date: Tue, 16 Feb 2021 12:46:24 +0100 From: Christoph Hellwig To: Mike Snitzer Message-ID: <20210216114624.GA1221@lst.de> References: <20201116145809.410558-1-hch@lst.de> <20201116145809.410558-13-hch@lst.de> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Wed, 17 Feb 2021 10:31:26 -0500 Cc: Justin Sanders , "Michael S. Tsirkin" , Jason Wang , linux-nvme@lists.infradead.org, Song Liu , device-mapper development , Christoph Hellwig , "linux-scsi@vger.kernel.org" , xen-devel@lists.xenproject.org, Ilya Dryomov , Jack Wang , Konrad Rzeszutek Wilk , Josef Bacik , nbd@other.debian.org, "linux-raid@vger.kernel.org" , Stefan Hajnoczi , drbd-dev@tron.linbit.com, ceph-devel@vger.kernel.org, Jens Axboe , linux-block , "Martin K. Petersen" , Minchan Kim , linux-fsdevel , Paolo Bonzini , Roger Pau =?iso-8859-1?Q?Monn=E9?= Subject: Re: [dm-devel] [PATCH 12/78] dm: use set_capacity_and_notify X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, Feb 12, 2021 at 10:45:32AM -0500, Mike Snitzer wrote: > On Mon, Nov 16, 2020 at 10:05 AM Christoph Hellwig wrote: > > > > Use set_capacity_and_notify to set the size of both the disk and block > > device. This also gets the uevent notifications for the resize for free. > > > > Signed-off-by: Christoph Hellwig > > Reviewed-by: Hannes Reinecke > > --- > > drivers/md/dm.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/drivers/md/dm.c b/drivers/md/dm.c > > index c18fc25485186d..62ad44925e73ec 100644 > > --- a/drivers/md/dm.c > > +++ b/drivers/md/dm.c > > @@ -1971,8 +1971,7 @@ static struct dm_table *__bind(struct mapped_device *md, struct dm_table *t, > > if (size != dm_get_size(md)) > > memset(&md->geometry, 0, sizeof(md->geometry)); > > > > - set_capacity(md->disk, size); > > - bd_set_nr_sectors(md->bdev, size); > > + set_capacity_and_notify(md->disk, size); > > > > dm_table_event_callback(t, event_callback, md); > > > > Not yet pinned down _why_ DM is calling set_capacity_and_notify() with > a size of 0 but, when running various DM regression tests, I'm seeing > a lot of noise like: > > [ 689.240037] dm-2: detected capacity change from 2097152 to 0 > > Is this pr_info really useful? Should it be moved to below: if > (!capacity || !size) so that it only prints if a uevent is sent? In general I suspect such a size change might be interesting to users if it e.g. comes from a remote event. So I'd be curious why this happens with DM, and if we can detect some higher level gendisk state to supress it if it is indeed spurious. -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel