[PATCH 29/44] block: remove the nr_sects field in struct hd_struct

Christoph Hellwig hch at lst.de
Fri Nov 27 04:41:09 EST 2020


On Thu, Nov 26, 2020 at 07:04:08PM +0100, Jan Kara wrote:
> On Thu 26-11-20 18:52:08, Christoph Hellwig wrote:
> > On Thu, Nov 26, 2020 at 05:50:36PM +0100, Jan Kara wrote:
> > > > +	if (size == capacity ||
> > > > +	    (disk->flags & (GENHD_FL_UP | GENHD_FL_HIDDEN)) != GENHD_FL_UP)
> > > > +		return false;
> > > > +	pr_info("%s: detected capacity change from %lld to %lld\n",
> > > > +		disk->disk_name, size, capacity);
> > > > +	kobject_uevent_env(&disk_to_dev(disk)->kobj, KOBJ_CHANGE, envp);
> > > 
> > > I think we don't want to generate resize event for changes from / to 0...
> > 
> > Didn't you ask for that in the last round?
> 
> I've asked for the message - which you've added :). But the udev event was
> correct in the previous version IMHO...

Note that this version only prints if the gendisk is up.  So any initial
setup does not see a message.  I think that is a better indicator than
checking for 0.  Especially as say a remotely triggered change to 0
is an even worth printing, and except for DRBD all drivers did print
the message.

> 
> 								Honza
> -- 
> Jan Kara <jack at suse.com>
> SUSE Labs, CR
---end quoted text---



More information about the linux-mtd mailing list