Re: [dm-devel] [PATCH 22/23] drbd: implement REQ_OP_WRITE_ZEROES

2017-03-30 Thread Martin K. Petersen
Mike Snitzer writes: Mike, > But while discussing this effort with Jeff Moyer he asked: shouldn't the > zeroed blocks be provisioned? This is a fairly embarassing question not > to be able to answer in the moment. So I clearly need to learn what the > overall intent of

Re: [dm-devel] [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

Re: [dm-devel] [PATCH 22/23] drbd: implement REQ_OP_WRITE_ZEROES

2017-03-30 Thread Mike Snitzer
On Thu, Mar 30 2017 at 11:20am -0400, Martin K. Petersen wrote: > Mike Snitzer writes: > > > I can work on this now. Only question I have is: should DM thinp take > > care to zero any misaligned head and tail? (I assume so but with all > > the

Re: [dm-devel] [PATCH][RFC] dm raid: Fix NULL pointer dereference for raid1 without bitmap

2017-03-30 Thread Heinz Mauelshagen
Acked-by: Heinz Mauelshagen This is the simplest way to solve the issue at hand (bitmap_load() returns success with non-existing bitmap). Heinz On 03/30/2017 05:14 PM, km...@yandex-team.ru wrote: From: Dmitry Bilunov 4257e08 introduces a bitmap

[dm-devel] [PATCH][RFC] dm raid: Fix NULL pointer dereference for raid1 without bitmap

2017-03-30 Thread kmeaw
From: Dmitry Bilunov 4257e08 introduces a bitmap resize call during preresume phase. User can create a DM device with "raid" target configured as raid1 with no metadata devices to hold superblock/bitmap info. It can be achieved using the following sequence: truncate -s

Re: [dm-devel] [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; > >> >

Re: [dm-devel] [PATCH 23/23] block: remove the discard_zeroes_data flag

2017-03-30 Thread h...@lst.de
On Thu, Mar 30, 2017 at 11:29:29AM -0400, Martin K. Petersen wrote: > "h...@lst.de" writes: > > > Jens, any opinion? I'd like to remove it too, but I fear it might > > break things. We could deprecate it first with a warning when read > > and then remove it a few releases down the

Re: [dm-devel] [PATCH 23/23] block: remove the discard_zeroes_data flag

2017-03-30 Thread Martin K. Petersen
"h...@lst.de" writes: > Jens, any opinion? I'd like to remove it too, but I fear it might > break things. We could deprecate it first with a warning when read > and then remove it a few releases down the road. I know of several apps that check this variable (as opposed to the

Re: [dm-devel] [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

Re: [dm-devel] RFC: always use REQ_OP_WRITE_ZEROES for zeroing offload

2017-03-30 Thread Martin K. Petersen
Mike Snitzer writes: > Would be very useful, particularly for testing, if > drivers/scsi/scsi_debug.c were updated to support WRITE ZEROES. There is no WRITE ZEROES in SCSI. You should be able to get the right behavior with lbpws=1 lbprz=1. -- Martin K. Petersen

Re: [dm-devel] [PATCH 22/23] drbd: implement REQ_OP_WRITE_ZEROES

2017-03-30 Thread Martin K. Petersen
Mike Snitzer writes: > I can work on this now. Only question I have is: should DM thinp take > care to zero any misaligned head and tail? (I assume so but with all > the back and forth between Bart, Paolo and Martin I figured I'd ask > explicitly). Yep, let's make sure our

Re: [dm-devel] RFC: always use REQ_OP_WRITE_ZEROES for zeroing offload

2017-03-30 Thread Mike Snitzer
Would be very useful, particularly for testing, if drivers/scsi/scsi_debug.c were updated to support WRITE ZEROES. -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 22/23] drbd: implement REQ_OP_WRITE_ZEROES

2017-03-30 Thread Mike Snitzer
On Thu, Mar 30 2017 at 7:44am -0400, Christoph Hellwig wrote: > On Thu, Mar 30, 2017 at 12:06:41PM +0200, Lars Ellenberg wrote: > > > Will it make an fstrim cause thinly provisioned > > devices to suddenly be fully allocated? > > Not for SCSI devices. Yes for dm-thinp until it

Re: [dm-devel] [Drbd-dev] [PATCH 22/23] drbd: implement REQ_OP_WRITE_ZEROES

2017-03-30 Thread Lars Ellenberg
On Thu, Mar 30, 2017 at 01:44:09PM +0200, Christoph Hellwig wrote: > On Thu, Mar 30, 2017 at 12:06:41PM +0200, Lars Ellenberg wrote: > > On Thu, Mar 23, 2017 at 10:33:40AM -0400, Christoph Hellwig wrote: > > > It seems like DRBD assumes its on the wire TRIM request always zeroes > > > data. > > >

Re: [dm-devel] [PATCH 22/23] drbd: implement REQ_OP_WRITE_ZEROES

2017-03-30 Thread Christoph Hellwig
On Thu, Mar 30, 2017 at 12:06:41PM +0200, Lars Ellenberg wrote: > On Thu, Mar 23, 2017 at 10:33:40AM -0400, Christoph Hellwig wrote: > > It seems like DRBD assumes its on the wire TRIM request always zeroes data. > > Use that fact to implement REQ_OP_WRITE_ZEROES. > > > > XXX: will need a careful

Re: [dm-devel] [PATCH 22/23] drbd: implement REQ_OP_WRITE_ZEROES

2017-03-30 Thread Lars Ellenberg
On Thu, Mar 23, 2017 at 10:33:40AM -0400, Christoph Hellwig wrote: > It seems like DRBD assumes its on the wire TRIM request always zeroes data. > Use that fact to implement REQ_OP_WRITE_ZEROES. > > XXX: will need a careful audit from the drbd team! Thanks, this one looks ok to me. The real

Re: [dm-devel] [PATCH 23/23] block: remove the discard_zeroes_data flag

2017-03-30 Thread h...@lst.de
On Tue, Mar 28, 2017 at 05:00:48PM +, Bart Van Assche wrote: > > It seems to me like the documentation in Documentation/ABI/testing/sysfs-block > and the above code are not in sync. I think the above code will cause reading > from the discard_zeroes_data attribute to return an empty string

Re: [dm-devel] RFC: always use REQ_OP_WRITE_ZEROES for zeroing offload

2017-03-30 Thread Christoph Hellwig
Lars, can you please take a look a patch 22 and check if it's safe? That's the big thing I want to know before posting the next version of the series. If it's not safe I'd like to drop that patch. -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [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 >

Re: [dm-devel] [PATCH 11/23] block_dev: use blkdev_issue_zerout for hole punches

2017-03-30 Thread h...@lst.de
On Tue, Mar 28, 2017 at 04:50:47PM +, Bart Van Assche wrote: > On Thu, 2017-03-23 at 10:33 -0400, Christoph Hellwig wrote: > > This gets us support for non-discard efficient write of zeroes (e.g. NVMe) > > and preparse for removing the discard_zeroes_data flag. > > Hello Christoph, > >