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=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 9FAABC433E6 for ; Fri, 12 Feb 2021 15:46:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75AD364E39 for ; Fri, 12 Feb 2021 15:46:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231892AbhBLPq0 (ORCPT ); Fri, 12 Feb 2021 10:46:26 -0500 Received: from mail-pl1-f173.google.com ([209.85.214.173]:41505 "EHLO mail-pl1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231708AbhBLPqY (ORCPT ); Fri, 12 Feb 2021 10:46:24 -0500 Received: by mail-pl1-f173.google.com with SMTP id a16so52073plh.8; Fri, 12 Feb 2021 07:46:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M8C1yZZgp4rNPfghNpxWN41GpCK1+InKLAelhxbvplw=; b=hZpgfmnlksgx4IeXq+4uYsXgBiV3Wuv56ZbgzH+aODufu6JzmrkVSl1zfOG+vrp5S2 d8GPPaPIMLhL6ospHexo/xpsl4e1XGzbdBRs467jodP7d3MrFjX46vnwsHOVJFChdBH5 tseGkI62kfbRh6eWkNbJrqZj1TqWHajscSaxyZpAFu930nQQcWNNG7jiuXXBO5wKxOWN 5aGPufUTGO3VyKo2Ffw2oy1g4Bg50PH7mZnxHovAb6qk1MRZhoq3c5t3bKcIF+f5Y/Pl emUwXIdnaEx5GI4J5Bw0SBrBiV3IJzy/DPJ3OmumUL7lyecbVcDUoi0G/9+kjyXRpnwN mx0Q== X-Gm-Message-State: AOAM531UnBQkbBwvSl/q2ii7gF5ZoLWAklsVZ4aGXm6S7kaW8j2j+YXQ y98I2MPc0YBWiZ+aANc+U1N7VYl4kLuPrPT4/xI= X-Google-Smtp-Source: ABdhPJyYCXBmQgiV5syIf5Cv8mFWKTwy1gjS5Yhyhg4Qi/jYzZasdmgfRgJp2ybsEGtlgybQDIghy8J0Yy2+jaKx2kI= X-Received: by 2002:a17:90a:4e1:: with SMTP id g88mr3222886pjg.7.1613144743400; Fri, 12 Feb 2021 07:45:43 -0800 (PST) MIME-Version: 1.0 References: <20201116145809.410558-1-hch@lst.de> <20201116145809.410558-13-hch@lst.de> In-Reply-To: <20201116145809.410558-13-hch@lst.de> From: Mike Snitzer Date: Fri, 12 Feb 2021 10:45:32 -0500 Message-ID: Subject: Re: [PATCH 12/78] dm: use set_capacity_and_notify To: Christoph Hellwig Cc: Jens Axboe , Justin Sanders , Josef Bacik , Ilya Dryomov , Jack Wang , "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Konrad Rzeszutek Wilk , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Minchan Kim , Song Liu , "Martin K. Petersen" , device-mapper development , linux-block , drbd-dev@lists.linbit.com, nbd@other.debian.org, ceph-devel@vger.kernel.org, xen-devel@lists.xenproject.org, "linux-raid@vger.kernel.org" , linux-nvme@lists.infradead.org, "linux-scsi@vger.kernel.org" , linux-fsdevel , Hannes Reinecke Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org 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? Mike 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=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 A1A31C433E0 for ; Fri, 12 Feb 2021 15:45:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5949364E65 for ; Fri, 12 Feb 2021 15:45:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5949364E65 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EWp9JLX1umRa7+YNLu3LgQO7AvNbLpcwU1eXfqqzbxM=; b=lTLg1cw92Zc0zQlXU7sKqUFAt GFXHGCerrhsiQ3Oeo4nolIghAiYxbLQJXZaWfpUpqtfx+KzDodN+TAK/hInCvrFfUYcTW9I4hldy+ AqsX6itcCJVSP5F8agJTlEVmVXZZL7kyAHO4zcoVkZegLmMdsHQ8Va4KLpl60sFzkc/hvt+0ooi1S zidaRESPDMxmXgGPC3jKtwlCS9wB4/haaEfLVWbAipboRAWZ4onA5fANUJB63iFKD420s10ttkR+j d0KD5ETSSsWR7HDfb7oFDa5HbHlm8be2vLM4iGSuR27JZJOHQMFbOPDVd3tJbLRoJq37OujXEIPgT 81C3Q1lcg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAadg-0004bw-LQ; Fri, 12 Feb 2021 15:45:48 +0000 Received: from mail-pl1-f181.google.com ([209.85.214.181]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAadd-0004bE-NJ for linux-nvme@lists.infradead.org; Fri, 12 Feb 2021 15:45:46 +0000 Received: by mail-pl1-f181.google.com with SMTP id d15so64488plh.4 for ; Fri, 12 Feb 2021 07:45:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M8C1yZZgp4rNPfghNpxWN41GpCK1+InKLAelhxbvplw=; b=lz9hiGJSZqxwy3Od1Y6vRWK12osCxadR4NSpc5BvKfpd+FvLcnfBunKGsAxyV8WD9S WQ+DJjFI4U2cKXJiavkv3K9CAemfHvxGzj8CFuQgAey7kZZzETJR32jAgz8+B70KLDoo rGRy9m0j7ms8esoeCPHFLuuIa5fO+kBVd5QRQU5i7OYsssn3oQ1qGn1SRGQe2+63/ceb wH8BYz7MY8/A+zSILGW++9mTOtvdv13W+MYlClR+IbBslr3nMEK5jAKgWWXxUJ0xaz+T izgk0E2oFhu2KR88g/s2DtkvhTh2wArLS/fn3teGL0oY/qtIiITtFdUqc1bV7F3aGMks LhGg== X-Gm-Message-State: AOAM532t1HkwHeA6bByS3KSnb92oeqkJeJ619hlbLbkozi6SyeSFT1SA WI8ksrVAoK9qgXLcxyjfqxvJAk/CkAXMzbjA3rk= X-Google-Smtp-Source: ABdhPJyYCXBmQgiV5syIf5Cv8mFWKTwy1gjS5Yhyhg4Qi/jYzZasdmgfRgJp2ybsEGtlgybQDIghy8J0Yy2+jaKx2kI= X-Received: by 2002:a17:90a:4e1:: with SMTP id g88mr3222886pjg.7.1613144743400; Fri, 12 Feb 2021 07:45:43 -0800 (PST) MIME-Version: 1.0 References: <20201116145809.410558-1-hch@lst.de> <20201116145809.410558-13-hch@lst.de> In-Reply-To: <20201116145809.410558-13-hch@lst.de> From: Mike Snitzer Date: Fri, 12 Feb 2021 10:45:32 -0500 Message-ID: Subject: Re: [PATCH 12/78] dm: use set_capacity_and_notify To: Christoph Hellwig X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210212_104545_776633_51413F5C X-CRM114-Status: GOOD ( 18.20 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Justin Sanders , "Michael S. Tsirkin" , Jason Wang , linux-nvme@lists.infradead.org, Song Liu , device-mapper development , drbd-dev@lists.linbit.com, "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" , Hannes Reinecke , Stefan Hajnoczi , ceph-devel@vger.kernel.org, Jens Axboe , linux-block , "Martin K. Petersen" , Minchan Kim , linux-fsdevel , Paolo Bonzini , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org 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? Mike _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme 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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 D5969C433DB for ; Wed, 17 Feb 2021 15:39:15 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.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 80DCF64D9F for ; Wed, 17 Feb 2021 15:39:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80DCF64D9F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613576354; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=R8ivDsVKvvXqHcEc7HtwERX3WuFspmMq9Ylax1TJgjM=; b=Wu+jUSxUnJtjOvYvRUMcBc17lHjAlMHsp5bFWhZMk902ROr+3ji6SdFSv/T8M1D30djFkB XPLSd92Emwne4cUk6wWiCU6db5fsfNTfFWrzRzsK+4dtaKK0hpXEss8nk86YGuJPK8k3Ar chQ38bwTtxx+Opx9o26nRz4gseVGKaE= 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-476-Ynf62IUfOD-_5v2PiaqCJg-1; Wed, 17 Feb 2021 10:39:12 -0500 X-MC-Unique: Ynf62IUfOD-_5v2PiaqCJg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A1FB0835E21; Wed, 17 Feb 2021 15:39:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A8A319C46; Wed, 17 Feb 2021 15:39:06 +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 1037C18095CC; Wed, 17 Feb 2021 15:39:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11CFjqwE028262 for ; Fri, 12 Feb 2021 10:45:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1E2F92026D14; Fri, 12 Feb 2021 15:45:52 +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 178302026D16 for ; Fri, 12 Feb 2021 15:45:49 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 3F4A2811760 for ; Fri, 12 Feb 2021 15:45:49 +0000 (UTC) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-513-EiJSWOWUODaOq-bAZgrXcA-1; Fri, 12 Feb 2021 10:45:45 -0500 X-MC-Unique: EiJSWOWUODaOq-bAZgrXcA-1 Received: by mail-pj1-f53.google.com with SMTP id z9so635532pjl.5; Fri, 12 Feb 2021 07:45:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M8C1yZZgp4rNPfghNpxWN41GpCK1+InKLAelhxbvplw=; b=ojSi3IEpL9r8XIac1ubEpvXAM/p+XtqMfcfsFWPlq38RvIE+VlvO32DcP/QcuRhQHT T5CqB792vO1ZQS+xH7w+rhgmejfqKCNqTA9LKYhq6RGXbUgM0p3U3ArBJF641VpMJCjg V0w13xZOAfgo/G/BYtgQhm/9DawPEfuY7/bEP3WSi2SeQc264jjySA5gKO1zPe++DCgD k0wsSEZtWfjkZLfGP2dnjnaq8ojyYwVgtpds3A4z24pXQLJdJuj+CaXc3urssTwgL5eP kF5e1erguHkmg3gvt6R4sC4w5Nv7puvuUxx6g6dp8r7MrVsIYOQZM/O9s8EKPNrC+yO9 QDOQ== X-Gm-Message-State: AOAM530/cTaONW0+x9XuOVUhayQoL1Hc092DBURDCYN+WQGKB2BjQdce w7iuBFBadVPkL1krrcsKD2ynv8cvMMYfDM/wtr21iFKHgnODngXj X-Google-Smtp-Source: ABdhPJyYCXBmQgiV5syIf5Cv8mFWKTwy1gjS5Yhyhg4Qi/jYzZasdmgfRgJp2ybsEGtlgybQDIghy8J0Yy2+jaKx2kI= X-Received: by 2002:a17:90a:4e1:: with SMTP id g88mr3222886pjg.7.1613144743400; Fri, 12 Feb 2021 07:45:43 -0800 (PST) MIME-Version: 1.0 References: <20201116145809.410558-1-hch@lst.de> <20201116145809.410558-13-hch@lst.de> In-Reply-To: <20201116145809.410558-13-hch@lst.de> From: Mike Snitzer Date: Fri, 12 Feb 2021 10:45:32 -0500 Message-ID: To: Christoph Hellwig 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.4 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 , "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 , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= 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.84 on 10.5.11.23 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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? Mike -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel