From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753483AbdDLAFj (ORCPT ); Tue, 11 Apr 2017 20:05:39 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:29905 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752327AbdDLAFf (ORCPT ); Tue, 11 Apr 2017 20:05:35 -0400 X-IronPort-AV: E=Sophos;i="5.37,187,1488844800"; d="scan'208";a="678559814" Date: Tue, 11 Apr 2017 17:05:28 -0700 From: Marc Olson To: Konrad Rzeszutek Wilk CC: , Roger Pau =?iso-8859-1?Q?Monn=E9?= , Boris Ostrovsky , "David Vrabel" , Subject: Re: [PATCH] blkfront: add uevent for size change Message-ID: <20170412000528.GA13555@amazon.com> References: <20170411192403.GA26778@amazon.com> <20170411200459.GB30956@char.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170411200459.GB30956@char.us.oracle.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.43.161.16] X-ClientProxiedBy: EX13D13UWA001.ant.amazon.com (10.43.160.136) To EX13D16UWC004.ant.amazon.com (10.43.162.72) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 11, 2017 at 04:04:59PM -0400, Konrad Rzeszutek Wilk wrote: > On Tue, Apr 11, 2017 at 12:24:09PM -0700, Marc Olson wrote: > > When a blkfront device is resized from dom0, emit a KOBJ_CHANGE uevent to > > notify the guest about the change. This allows for custom udev rules, such > > as automatically resizing a filesystem, when an event occurs. > > Looks pretty reasonable. > > Could you confirm what the udevadm --monitor --kernel --udev emits when this happens? Relevant output: KERNEL[577.206230] change /devices/vbd-51728/block/xvdb (block) UDEV [577.226218] change /devices/vbd-51728/block/xvdb (block) Of course, this is missing without the patch. /marc > > Thanks! > > > > > Signed-off-by: Marc Olson > > --- > > drivers/block/xen-blkfront.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c > > index 2fee2ee..66abf9c 100644 > > --- a/drivers/block/xen-blkfront.c > > +++ b/drivers/block/xen-blkfront.c > > @@ -1996,6 +1996,7 @@ static void blkfront_connect(struct blkfront_info *info) > > unsigned long sector_size; > > unsigned int physical_sector_size; > > unsigned int binfo; > > + char *envp[] = { "RESIZE=1", NULL }; > > int err; > > > > switch (info->connected) { > > @@ -2012,6 +2013,8 @@ static void blkfront_connect(struct blkfront_info *info) > > sectors); > > set_capacity(info->gd, sectors); > > revalidate_disk(info->gd); > > + kobject_uevent_env(&disk_to_dev(info->gd)->kobj, > > + KOBJ_CHANGE, envp); > > > > return; > > case BLKIF_STATE_SUSPENDED: > > -- > > 2.7.4 > > >