Re: [PATCH 12/23] sd: handle REQ_UNMAP

2017-03-31 Thread h...@lst.de
On Thu, Mar 30, 2017 at 10:19:55PM -0400, Martin K. Petersen wrote: > > If you manually change the provisioning mode to WS10 on a device that > > must use WRITE SAME (16) to be able to address all blocks you're already > > screwed right now, and with this patch you can screw yourself through > > th

Re: [PATCH 12/23] sd: handle REQ_UNMAP

2017-03-30 Thread Martin K. Petersen
"h...@lst.de" writes: > If you manually change the provisioning mode to WS10 on a device that > must use WRITE SAME (16) to be able to address all blocks you're already > screwed right now, and with this patch you can screw yourself through > the WRITE_ZEROES path in addition to the DISCARD path.

Re: [PATCH 12/23] sd: handle REQ_UNMAP

2017-03-30 Thread h...@lst.de
On Thu, Mar 30, 2017 at 11:28:32AM -0400, Martin K. Petersen wrote: > "h...@lst.de" writes: > > Christoph, > > > On Tue, Mar 28, 2017 at 04:48:55PM +, Bart Van Assche wrote: > >> > if (sdp->no_write_same) > >> > return BLKPREP_INVALID; > >> > if (sdkp->ws16

Re: [PATCH 12/23] sd: handle REQ_UNMAP

2017-03-30 Thread Martin K. Petersen
"h...@lst.de" writes: Christoph, > On Tue, Mar 28, 2017 at 04:48:55PM +, Bart Van Assche wrote: >> >if (sdp->no_write_same) >> >return BLKPREP_INVALID; >> >if (sdkp->ws16 || sector > 0x || nr_sectors > 0x) >> >> Users can change the provisioning mode from use

Re: [PATCH 12/23] sd: handle REQ_UNMAP

2017-03-30 Thread h...@lst.de
On Tue, Mar 28, 2017 at 04:48:55PM +, Bart Van Assche wrote: > > if (sdp->no_write_same) > > return BLKPREP_INVALID; > > if (sdkp->ws16 || sector > 0x || nr_sectors > 0x) > > Users can change the provisioning mode from user space fromĀ SD_LBP_WS16 into > SD_LBP_W

Re: [PATCH 12/23] sd: handle REQ_UNMAP

2017-03-29 Thread Paolo Bonzini
On 28/03/2017 18:48, Bart Van Assche wrote: >> +if (rq->cmd_flags & REQ_UNMAP) { >> +switch (sdkp->provisioning_mode) { >> +case SD_LBP_WS16: >> +return sd_setup_write_same16_cmnd(cmd, true); >> +case SD_LBP_WS10: >> +

Re: [PATCH 12/23] sd: handle REQ_UNMAP

2017-03-28 Thread Bart Van Assche
On Thu, 2017-03-23 at 10:33 -0400, Christoph Hellwig wrote: > Try to use a write same with unmap bit variant if the device supports it > and the caller asks for it. > > Signed-off-by: Christoph Hellwig > --- > drivers/scsi/sd.c | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git

[PATCH 12/23] sd: handle REQ_UNMAP

2017-03-23 Thread Christoph Hellwig
Try to use a write same with unmap bit variant if the device supports it and the caller asks for it. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index b6f70a09a301..ca96bb33471b 10064