lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1b88bedc6d5435fa7154f3356fa3f1a3e6888ded.camel@amazon.com>
Date:   Mon, 6 Jan 2020 00:46:26 +0000
From:   "Singh, Balbir" <sblbir@...zon.com>
To:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Chaitanya.Kulkarni@....com" <Chaitanya.Kulkarni@....com>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>
CC:     "hch@....de" <hch@....de>,
        "jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
        "mst@...hat.com" <mst@...hat.com>,
        "axboe@...nel.dk" <axboe@...nel.dk>,
        "Sangaraju, Someswarudu" <ssomesh@...zon.com>
Subject: Re: [resend v1 4/5] drivers/nvme/host/core.c: Convert to use
 disk_set_capacity

On Sat, 2020-01-04 at 22:27 +0000, Chaitanya Kulkarni wrote:
> Quick question here if user executes nvme ns-rescan /dev/nvme1
> will following code result in triggering uevent(s) for
> the namespace(s( for which there is no change in the size ?
> 
> If so is that an expected behavior ?
> 

My old code had a check to see if old_capacity != new_capacity as well.
I can redo those bits if needed.

The expected behaviour is not clear, but the functionality is not broken, user
space should be able to deal with a resize event where the previous capacity
== new capacity IMHO.

Balbir Singh.


> On 01/01/2020 11:54 PM, Balbir Singh wrote:
> > block/genhd provides disk_set_capacity() for sending
> > RESIZE notifications via uevents. This notification is
> > newly added to NVME devices
> > 
> > Signed-off-by: Balbir Singh <sblbir@...zon.com>
> > ---
> >   drivers/nvme/host/core.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> > index 667f18f465be..cb214e914fc2 100644
> > --- a/drivers/nvme/host/core.c
> > +++ b/drivers/nvme/host/core.c
> > @@ -1808,7 +1808,7 @@ static void nvme_update_disk_info(struct gendisk
> > *disk,
> >   	    ns->lba_shift > PAGE_SHIFT)
> >   		capacity = 0;
> > 
> > -	set_capacity(disk, capacity);
> > +	disk_set_capacity(disk, capacity);


> > 
> >   	nvme_config_discard(disk, ns);
> >   	nvme_config_write_zeroes(disk, ns);
> > 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ