[PATCH 1/5] nvme: move ->retries setup to nvme_setup_cmd

2017-04-05 Thread Christoph Hellwig
This way we get the behavior right for the non-PCIe transports. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 5 + drivers/nvme/host/pci.c | 4 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index

[PATCH 17/27] loop: implement REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
It's identical to discard as hole punches will always leave us with zeroes on reads. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/loop.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index cc981f3

[PATCH 14/27] sd: implement unmapping Write Zeroes

2017-04-05 Thread Christoph Hellwig
Try to use a write same with unmap bit variant if the device supports it and the caller allows for it. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- drivers/scsi/sd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/scsi

[PATCH 16/27] zram: implement REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
Just the same as discard if the block size equals the system page size. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/zram/zram_drv.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers

[PATCH 11/27] block: add a REQ_NOUNMAP flag for REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
change. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- block/blk-lib.c | 19 +-- include/linux/blk_types.h | 6 ++ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c

[PATCH 09/27] block: stop using blkdev_issue_write_same for zeroing

2017-04-05 Thread Christoph Hellwig
We'll always use the WRITE ZEROES code for zeroing now. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- block/blk-lib.c | 4 1 file changed, 4 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index e5b853f2b8a2..2a8d638

[PATCH 05/27] md: support REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
Copy & paste from the REQ_OP_WRITE_SAME code. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/md/linear.c| 1 + drivers/md/md.h| 7 +++ drivers/md/multipath.c | 1 + drivers/md/raid0.c | 2 ++ drivers/md/raid1.c | 4 +++- drivers/md/raid

[PATCH 04/27] sd: implement REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- drivers/scsi/sd.c | 31 ++- drivers/scsi/sd_zbc.c | 1 + 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c

[PATCH 08/27] dm kcopyd: switch to use REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
It seems like the code currently passes whatever it was using for writes to WRITE SAME. Just switch it to WRITE ZEROES, although that doesn't need any payload. Untested, and confused by the code, maybe someone who understands it better than me can help.. Signed-off-by: Christoph He

[PATCH 03/27] block: implement splitting of REQ_OP_WRITE_ZEROES bios

2017-04-05 Thread Christoph Hellwig
Copy and past the REQ_OP_WRITE_SAME code to prepare to implementations that limit the write zeroes size. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- block/blk-merge.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions

[PATCH 06/27] dm io: discards don't take a payload

2017-04-05 Thread Christoph Hellwig
Fix up do_region to not allocate a bio_vec for discards. We've got rid of the discard payload allocated by the caller years ago. Obviously this wasn't actually harmful given how long it's been there, but it's still good to avoid the pointless allocation. Signed-off-b

[PATCH 07/27] dm: support REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
Copy & paste from the REQ_OP_WRITE_SAME code. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/md/dm-core.h | 1 + drivers/md/dm-io.c| 8 ++-- drivers/md/dm-linear.c| 1 + drivers/md/dm-mpath.c | 1 + drivers/md/dm-

[PATCH 02/27] block: renumber REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
Make life easy for implementations that needs to send a data buffer to the device (e.g. SCSI) by numbering it as a data out command. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- include/linux/blk_types.h | 2 +- 1 file changed, 1 insertion

[PATCH 01/27] sd: split sd_setup_discard_cmnd

2017-04-05 Thread Christoph Hellwig
Zeroes operation. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- drivers/scsi/sd.c | 153 ++ 1 file changed, 84 insertions(+), 69 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c

always use REQ_OP_WRITE_ZEROES for zeroing offload V2

2017-04-05 Thread Christoph Hellwig
This series makes REQ_OP_WRITE_ZEROES the only zeroing offload supported by the block layer, and switches existing implementations of REQ_OP_DISCARD that correctly set discard_zeroes_data to it, removes incorrect discard_zeroes_data, and also switches WRITE SAME based zeroing in SCSI to this new me

[PATCH 10/27] block: add a flags argument to (__)blkdev_issue_zeroout

2017-04-05 Thread Christoph Hellwig
Turn the existing discard flag into a new BLKDEV_ZERO_UNMAP flag with similar semantics, but without referring to diѕcard. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- block/blk-lib.c| 31

[PATCH 12/27] block: add a new BLKDEV_ZERO_NOFALLBACK flag

2017-04-05 Thread Christoph Hellwig
This avoids fallbacks to explicit zeroing in (__)blkdev_issue_zeroout if the caller doesn't want them. Also clean up the convoluted check for the return condition that this new flag is added to. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Rei

[PATCH 13/27] block_dev: use blkdev_issue_zerout for hole punches

2017-04-05 Thread Christoph Hellwig
This gets us support for non-discard efficient write of zeroes (e.g. NVMe) and prepares for removing the discard_zeroes_data flag. Also remove a pointless discard support check, which is done in blkdev_issue_discard already. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen

[PATCH 15/27] nvme: implement REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
But now for the real NVMe Write Zeroes yet, just to get rid of the discard abuse for zeroing. Also rename the quirk flag to be a bit more self-explanatory. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- drivers/nvme/host/core.c | 10

Re: always use REQ_OP_WRITE_ZEROES for zeroing offload V2

2017-04-05 Thread Christoph Hellwig
Looks like the mail server crapped out under the load.. I'll resend tomorrow morning, in the meantime the git url below works. On Wed, Apr 05, 2017 at 04:21:38PM +0200, Christoph Hellwig wrote: > This series makes REQ_OP_WRITE_ZEROES the only zeroing offload > supported by the block

Re: [PATCH 1/5] nvme: move ->retries setup to nvme_setup_cmd

2017-04-05 Thread Christoph Hellwig
On Wed, Apr 05, 2017 at 04:43:34PM +0200, Johannes Thumshirn wrote: > On Wed, Apr 05, 2017 at 04:18:52PM +0200, Christoph Hellwig wrote: > > This way we get the behavior right for the non-PCIe transports. > > Could you please share a bit of your minds inner workings for us mere

Re: [PATCH 4/5] nvme: move the retries count to struct nvme_request

2017-04-05 Thread Christoph Hellwig
On Wed, Apr 05, 2017 at 11:14:30AM -0400, Keith Busch wrote: > On Wed, Apr 05, 2017 at 04:18:55PM +0200, Christoph Hellwig wrote: > > The way NVMe uses this field is entirely different from the older > > SCSI/BLOCK_PC usage, so move it into struct nvme_request. > > > >

[PATCH 1/5] nvme: move ->retries setup to nvme_setup_cmd

2017-04-05 Thread Christoph Hellwig
->retries is counting the number of times a command is resubmitted, and be cleared on the first time we see the command. We currently don't do that for non-PCIe command, which is easily fixed by moving the setup to common code. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/co

[PATCH 5/5] block, scsi: move the retries field to struct scsi_request

2017-04-05 Thread Christoph Hellwig
Instead of bloating the generic struct request with it. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- block/scsi_ioctl.c | 8 drivers/scsi/osd/osd_initiator.c | 2 +- drivers/scsi/osst.c| 2 +- drivers/scsi/scsi_error.c

->retries fixups V2

2017-04-05 Thread Christoph Hellwig
This series fixes a few lose bits in terms of how nvme uses ->retries, including fixing it for non-PCIe transports. While at it I noticed that nvme and scsi use the field in entirely different ways, and no other driver uses it at all. So I decided to move it into the nvme_request and scsi_request

[PATCH 4/5] nvme: move the retries count to struct nvme_request

2017-04-05 Thread Christoph Hellwig
The way NVMe uses this field is entirely different from the older SCSI/BLOCK_PC usage, so move it into struct nvme_request. Also reduce the size of the file to a unsigned char so that we leave space for additional smaller fields that will appear soon. Signed-off-by: Christoph Hellwig Reviewed

[PATCH 2/5] nvme: cleanup nvme_req_needs_retry

2017-04-05 Thread Christoph Hellwig
Don't pass the status explicitly but derive it from the requeust, and unwind the complex condition to be more readable. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/nvme/host/core.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-)

[PATCH 3/5] nvme: mark nvme_max_retries static

2017-04-05 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/nvme/host/core.c | 3 +-- drivers/nvme/host/nvme.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index b225aacf4b89..933e67c60e33 100644 --- a

[PATCH 26/27] scsi: sd: Separate zeroout and discard command choices

2017-04-05 Thread Christoph Hellwig
ff-by: Martin K. Petersen Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 56 --- drivers/scsi/sd.h | 8 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index bcb0cb020fd2..acf9

[PATCH 25/27] block: remove the discard_zeroes_data flag

2017-04-05 Thread Christoph Hellwig
Now that we use the proper REQ_OP_WRITE_ZEROES operation everywhere we can kill this hack. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- Documentation/ABI/testing/sysfs-block | 10 ++- Documentation/block/queue-sysfs.txt | 5

[PATCH 27/27] scsi: sd: Remove LBPRZ dependency for discards

2017-04-05 Thread Christoph Hellwig
ts for discards. Signed-off-by: Martin K. Petersen Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 25 ++--- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index acf9d17b05d8..8cf34a8e3eea 100644 --- a/drivers/

[PATCH 22/27] block: stop using discards for zeroing

2017-04-05 Thread Christoph Hellwig
Now that we have REQ_OP_WRITE_ZEROES implemented for all devices that support efficient zeroing, we can remove the call to blkdev_issue_discard. This means we only have two ways of zeroing left and can simplify the code. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed

[PATCH 09/27] block: stop using blkdev_issue_write_same for zeroing

2017-04-05 Thread Christoph Hellwig
We'll always use the WRITE ZEROES code for zeroing now. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- block/blk-lib.c | 4 1 file changed, 4 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index e5b853f2b8a2..2a8d638

[PATCH 20/27] rsxx: remove the discard_zeroes_data flag

2017-04-05 Thread Christoph Hellwig
rsxx only supports discarding on large alignments, so the zeroing code would always fall back to explicit writings of zeroes. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/rsxx/dev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/block/rsxx/dev.c b

[PATCH 11/27] block: add a REQ_NOUNMAP flag for REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
change. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- block/blk-lib.c | 19 +-- include/linux/blk_types.h | 6 ++ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c

[PATCH 21/27] mmc: remove the discard_zeroes_data flag

2017-04-05 Thread Christoph Hellwig
mmc only supports discarding on large alignments, so the zeroing code would always fall back to explicit writings of zeroes. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/mmc/core/queue.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mmc/core/queue.c

[PATCH 13/27] block_dev: use blkdev_issue_zerout for hole punches

2017-04-05 Thread Christoph Hellwig
This gets us support for non-discard efficient write of zeroes (e.g. NVMe) and prepares for removing the discard_zeroes_data flag. Also remove a pointless discard support check, which is done in blkdev_issue_discard already. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen

[PATCH 18/27] brd: remove discard support

2017-04-05 Thread Christoph Hellwig
It's just a in-driver reimplementation of writing zeroes to the pages, which fails if the discards aren't page aligned. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/brd.c | 54 - 1 file changed, 54

[PATCH 08/27] dm kcopyd: switch to use REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
It seems like the code currently passes whatever it was using for writes to WRITE SAME. Just switch it to WRITE ZEROES, although that doesn't need any payload. Untested, and confused by the code, maybe someone who understands it better than me can help.. Signed-off-by: Christoph He

[PATCH 17/27] loop: implement REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
It's identical to discard as hole punches will always leave us with zeroes on reads. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/loop.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index cc981f3

[PATCH 14/27] sd: implement unmapping Write Zeroes

2017-04-05 Thread Christoph Hellwig
Try to use a write same with unmap bit variant if the device supports it and the caller allows for it. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- drivers/scsi/sd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/scsi

[PATCH 23/27] drbd: make intelligent use of blkdev_issue_zeroout

2017-04-05 Thread Christoph Hellwig
drbd always wants its discard wire operations to zero the blocks, so use blkdev_issue_zeroout with the BLKDEV_ZERO_UNMAP flag instead of reinventing it poorly. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/drbd/drbd_debugfs.c | 3 -- drivers/block/drbd

[PATCH 12/27] block: add a new BLKDEV_ZERO_NOFALLBACK flag

2017-04-05 Thread Christoph Hellwig
This avoids fallbacks to explicit zeroing in (__)blkdev_issue_zeroout if the caller doesn't want them. Also clean up the convoluted check for the return condition that this new flag is added to. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Rei

[PATCH 15/27] nvme: implement REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
But now for the real NVMe Write Zeroes yet, just to get rid of the discard abuse for zeroing. Also rename the quirk flag to be a bit more self-explanatory. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- drivers/nvme/host/core.c | 10

[PATCH 16/27] zram: implement REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
Just the same as discard if the block size equals the system page size. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/zram/zram_drv.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers

[PATCH 19/27] rbd: remove the discard_zeroes_data flag

2017-04-05 Thread Christoph Hellwig
rbd only supports discarding on large alignments, so the zeroing code would always fall back to explicit writings of zeroes. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/rbd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/block/rbd.c b/drivers

[PATCH 10/27] block: add a flags argument to (__)blkdev_issue_zeroout

2017-04-05 Thread Christoph Hellwig
Turn the existing discard flag into a new BLKDEV_ZERO_UNMAP flag with similar semantics, but without referring to diѕcard. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- block/blk-lib.c| 31

[PATCH 24/27] drbd: implement REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
It seems like DRBD assumes its on the wire TRIM request always zeroes data. Use that fact to implement REQ_OP_WRITE_ZEROES. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/drbd/drbd_main.c | 3 ++- drivers/block/drbd/drbd_nl.c | 2 ++ drivers/block

[PATCH 02/27] block: renumber REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
Make life easy for implementations that needs to send a data buffer to the device (e.g. SCSI) by numbering it as a data out command. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- include/linux/blk_types.h | 2 +- 1 file changed, 1 insertion

[PATCH 07/27] dm: support REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
Copy & paste from the REQ_OP_WRITE_SAME code. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/md/dm-core.h | 1 + drivers/md/dm-io.c| 8 ++-- drivers/md/dm-linear.c| 1 + drivers/md/dm-mpath.c | 1 + drivers/md/dm-

[PATCH 03/27] block: implement splitting of REQ_OP_WRITE_ZEROES bios

2017-04-05 Thread Christoph Hellwig
Copy and past the REQ_OP_WRITE_SAME code to prepare to implementations that limit the write zeroes size. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- block/blk-merge.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions

[PATCH 01/27] sd: split sd_setup_discard_cmnd

2017-04-05 Thread Christoph Hellwig
Zeroes operation. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- drivers/scsi/sd.c | 153 ++ 1 file changed, 84 insertions(+), 69 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c

always use REQ_OP_WRITE_ZEROES for zeroing offload V2

2017-04-05 Thread Christoph Hellwig
This series makes REQ_OP_WRITE_ZEROES the only zeroing offload supported by the block layer, and switches existing implementations of REQ_OP_DISCARD that correctly set discard_zeroes_data to it, removes incorrect discard_zeroes_data, and also switches WRITE SAME based zeroing in SCSI to this new me

[PATCH 05/27] md: support REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
Copy & paste from the REQ_OP_WRITE_SAME code. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/md/linear.c| 1 + drivers/md/md.h| 7 +++ drivers/md/multipath.c | 1 + drivers/md/raid0.c | 2 ++ drivers/md/raid1.c | 4 +++- drivers/md/raid

[PATCH 04/27] sd: implement REQ_OP_WRITE_ZEROES

2017-04-05 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- drivers/scsi/sd.c | 31 ++- drivers/scsi/sd_zbc.c | 1 + 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c

[PATCH 06/27] dm io: discards don't take a payload

2017-04-05 Thread Christoph Hellwig
Fix up do_region to not allocate a bio_vec for discards. We've got rid of the discard payload allocated by the caller years ago. Obviously this wasn't actually harmful given how long it's been there, but it's still good to avoid the pointless allocation. Signed-off-b

Re: ->retries fixups V2

2017-04-05 Thread Christoph Hellwig
On Wed, Apr 05, 2017 at 12:06:53PM -0600, Jens Axboe wrote: > On Wed, Apr 05 2017, Christoph Hellwig wrote: > > This series fixes a few lose bits in terms of how nvme uses ->retries, > > including fixing it for non-PCIe transports. While at it I noticed that > > nvme a

Re: [PATCH 4/5] nvme: move the retries count to struct nvme_request

2017-04-06 Thread Christoph Hellwig
On Thu, Apr 06, 2017 at 04:35:56PM +0800, 廖亨权 wrote: > Hi, Guys, > I want to ask if there is any plan to plant the NVMe driver to > Vxworks OS?Thank you so much.---end quoted text--- The Linux NVMe team has no plans for a Vxworks NVMe driver at the moment.

[PATCH] remove the mg_disk driver

2017-04-06 Thread Christoph Hellwig
ff-by: Christoph Hellwig --- Documentation/blockdev/mflash.txt | 84 --- drivers/block/Kconfig | 17 - drivers/block/Makefile|1 - drivers/block/mg_disk.c | 1110 - include/linux/mg_disk.h | 45 -- 5 files changed,

Re: [PATCH 3/9] bio-integrity: bio_integrity_advance must update integrity seed

2017-04-06 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 4/9] bio-integrity: fix interface for bio_integrity_trim v2

2017-04-06 Thread Christoph Hellwig
Please drop the v2 from the subject line and move your changelog either into the cover letter (preferred) or at least below the --- line. Otherwise looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH 5/9] bio-integrity: fold bio_integrity_enabled to bio_integrity_prep

2017-04-06 Thread Christoph Hellwig
> --- a/Documentation/block/data-integrity.txt > +++ b/Documentation/block/data-integrity.txt > @@ -202,9 +202,6 @@ will require extra work due to the application tag. >added. It is up to the caller to ensure that the bio does not >change while I/O is in progress. > > - bio_

Re: [PATCH 6/9] T10: Move opencoded contants to common header

2017-04-06 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 7/9] Guard bvec iteration logic v3

2017-04-06 Thread Christoph Hellwig
> if (bio_no_advance_iter(bio)) > iter->bi_size -= bytes; > - else > - bvec_iter_advance(bio->bi_io_vec, iter, bytes); > + else { > + int err; > + err = bvec_iter_advance(bio->bi_io_vec, iter, bytes); > + if (unlikely(err))

Re: [PATCH 8/9] bio: add bvec_iter rewind API

2017-04-06 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig On Tue, Apr 04, 2017 at 10:56:40PM +0400, Dmitry Monakhov wrote: > Some ->bi_end_io handlers (for example: pi_verify or decrypt handlers) Just curious: are you planning to use it for the latter as well in future patches? If not can you at leas

Re: [PATCH 9/9] bio-integrity: Restore original iterator on verify stage

2017-04-06 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH] blk-mq-pci: Remove unneeded includes

2017-04-06 Thread Christoph Hellwig
Stephen added the first two includes after a linux-next build failure. Did this go through a long buildbot cycle to verify it's really not needed anymore? On Thu, Apr 06, 2017 at 01:33:36PM +0300, Sagi Grimberg wrote: > Signed-off-by: Sagi Grimberg > --- > block/blk-mq-pci.c | 3 --- > 1 file c

Re: [PATCH 0/6] RFC add blkdev tests v2

2017-04-06 Thread Christoph Hellwig
I still disagree with using xfstests for this. Even if we were going to treat the block devices nodes as yet another file system that's not what the patches do - they create specific virtual devices to test for each test. I think the right way is to keep your patches as-is and copy the few bits y

Re: [PATCH 0/6] RFC add blkdev tests v2

2017-04-06 Thread Christoph Hellwig
On Thu, Apr 06, 2017 at 08:33:55AM -0600, Jens Axboe wrote: > That is exactly what my recommendation was at lsfmm as well - fork > xfstest, prune bits we don't need, and off we go. I'll get around to > it soonish. So you volunteer to do it? I was -><- this close to offering it myself, and than th

[PATCH 01/25] remove the mg_disk driver

2017-04-06 Thread Christoph Hellwig
ff-by: Christoph Hellwig --- Documentation/blockdev/mflash.txt | 84 --- drivers/block/Kconfig | 17 - drivers/block/Makefile|1 - drivers/block/mg_disk.c | 1110 - include/linux/mg_disk.h | 45 -- 5 files changed,

[PATCH 04/25] nvme: split nvme status from block req->errors

2017-04-06 Thread Christoph Hellwig
block layer only when we actually need it. Because we can't overload the status value with a negative error code for cancelled command we now have a flags filed in struct nvme_request that contains a bit for this condition. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c

[PATCH 02/25] block: remove the blk_execute_rq return value

2017-04-06 Thread Christoph Hellwig
The function only returns -EIO if rq->errors is non-zero, which is not very useful and lets a large number of callers ignore the return value. Just let the callers figure out their error themselves. Signed-off-by: Christoph Hellwig --- block/blk-exec.c | 8 +--- bl

[PATCH 08/25] scsi: fix fast-fail for non-passthrough requests

2017-04-06 Thread Christoph Hellwig
value. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi_lib.c | 28 +++- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 11972d1075f1..89b4d9e69866 100644 --- a/drivers/scsi/scsi_lib.c +++ b

[PATCH 06/25] virtio: fix spelling of virtblk_scsi_request_done

2017-04-06 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/block/virtio_blk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index eaf99022bdc6..dbc4e80680b1 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block

[PATCH 05/25] nvme: make nvme_error_status private

2017-04-06 Thread Christoph Hellwig
audit from the lightnvm folks, though. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 3 +-- drivers/nvme/host/lightnvm.c | 8 drivers/nvme/host/nvme.h | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/h

[PATCH 07/25] virtio_blk: don't use req->errors

2017-04-06 Thread Christoph Hellwig
Remove passing req->errors (which at that point is always 0) to blk_mq_complete_requestq, and rely on the virtio status code for the serial number passthrough request. Signed-off-by: Christoph Hellwig --- drivers/block/virtio_blk.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deleti

[PATCH 03/25] nvme-fc: fix status code handling in nvme_fc_fcpio_done

2017-04-06 Thread Christoph Hellwig
: Christoph Hellwig --- drivers/nvme/host/fc.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index fc42172c796a..aad7f9c0be32 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -1147,7 +1147,7

kill req->errors

2017-04-06 Thread Christoph Hellwig
Currently the request structure has an errors field that is used in various different ways. The oldest drivers use it as an error count, blk-mq and the generic timeout code assume that it holds a Linux errno for block completions, and various drivers use it for internal status values, often overwr

[PATCH 10/25] loop: zero-fill bio on the submitting cpu

2017-04-06 Thread Christoph Hellwig
In thruth I've just audited which blk-mq drivers don't currently have a complete callback, but I think this change is at least borderline useful. Signed-off-by: Christoph Hellwig --- drivers/block/loop.c | 30 ++ drivers/block/loop.h | 1 + 2 files c

[PATCH 11/25] null_blk: don't pass always-0 req->errors to blk_mq_complete_request

2017-04-06 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/block/null_blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index f93906ff31e8..24ca85a70fd8 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c @@ -281,7

[PATCH 13/25] dm mpath: don't check for req->errors

2017-04-06 Thread Christoph Hellwig
We'll get all proper errors reported through ->end_io and ->errors will go away soon. Signed-off-by: Christoph Hellwig --- drivers/md/dm-mpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 7f223dbed49f..4

[PATCH 12/25] dm rq: don't pass irrelevant error code to blk_mq_complete_request

2017-04-06 Thread Christoph Hellwig
dm never uses rq->errors, so there is no need to pass an error argument to blk_mq_complete_request. Signed-off-by: Christoph Hellwig --- drivers/md/dm-rq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c index 6886bf160

[PATCH 14/25] nbd: don't use req->errors

2017-04-06 Thread Christoph Hellwig
Add a nbd-specific field instead. Signed-off-by: Christoph Hellwig --- drivers/block/nbd.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 03ae72985c79..4f045fab9659 100644 --- a/drivers/block

[PATCH 09/25] scsi: introduce a new result field in struct scsi_request

2017-04-06 Thread Christoph Hellwig
it. I didn't dare to touch this magic, so the abuses are brought forward 1:1. Signed-off-by: Christoph Hellwig --- block/bsg-lib.c| 8 block/bsg.c| 12 +-- block/scsi_ioctl.c | 14 ++--- drivers/block

[PATCH 17/25] blk-mq: remove the error argument to blk_mq_complete_request

2017-04-06 Thread Christoph Hellwig
Now that we always have a ->complete callback we can remove the direct call to blk_mq_end_request, as well as the error argument to blk_mq_complete_request. Signed-off-by: Christoph Hellwig --- block/blk-mq.c| 14 +++--- drivers/block/loop.c |

[PATCH 22/25] swim3: remove (commented out) printing of req->errors

2017-04-06 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/block/swim3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c index 61b3ffa4f458..ba4809c9bdba 100644 --- a/drivers/block/swim3.c +++ b/drivers/block/swim3.c @@ -343,8 +343,8

[PATCH 15/25] mtip32xx: add a status field to struct mtip_cmd

2017-04-06 Thread Christoph Hellwig
Instead of using req->errors, which will go away. Signed-off-by: Christoph Hellwig --- drivers/block/mtip32xx/mtip32xx.c | 16 +--- drivers/block/mtip32xx/mtip32xx.h | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/driv

[PATCH 18/25] blk-mq: simplify __blk_mq_complete_request

2017-04-06 Thread Christoph Hellwig
Merge blk_mq_ipi_complete_request and blk_mq_stat_add into their only caller. Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 393f350ebb90..a6e14a3c87ce 100644

[PATCH 23/25] pd: remove bogus check for req->errors

2017-04-06 Thread Christoph Hellwig
The driver never sets req->errors --- drivers/block/paride/pd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index 82c6d02193ae..3b0ab214fe74 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c @@ -7

[PATCH 25/25] block: remove the errors field from struct request

2017-04-06 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- block/blk-core.c | 14 +- block/blk-exec.c | 3 +-- block/blk-mq.c | 10 +++--- block/blk-timeout.c | 1 - include/linux/blkdev.h | 2 -- include/trace/events/block.h | 17

[PATCH 16/25] xen-blkfront: don't use req->errors

2017-04-06 Thread Christoph Hellwig
xen-blkfron is the last users using rq->errros for passing back error to blk-mq, and I'd like to get rid of that. In the longer run the driver should be moving more of the completion processing into .complete, but this is the minimal change to move forward for now. Signed-off-by: C

[PATCH 24/25] blktrace: remove the unused block_rq_abort tracepoint

2017-04-06 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/trace/events/block.h | 44 ++-- kernel/trace/blktrace.c | 9 - 2 files changed, 10 insertions(+), 43 deletions(-) diff --git a/include/trace/events/block.h b/include/trace/events/block.h index

[PATCH 21/25] ataflop: switch from req->errors to req->error_count

2017-04-06 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/block/ataflop.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index 2104b1b4ccda..fa69ecd52cb5 100644 --- a/drivers/block/ataflop.c +++ b/drivers/block/ataflop.c

[PATCH 20/25] floppy: switch from req->errors to req->error_count

2017-04-06 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/block/floppy.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index ce102ec47ef2..60d4c7653178 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -2805,8

[PATCH 19/25] block: add a error_count field to struct request

2017-04-06 Thread Christoph Hellwig
gned-off-by: Christoph Hellwig --- include/linux/blkdev.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index a03acd92ae74..fa75401ea5cc 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -175,6 +175,7 @@ struct

Re: [PATCH 0/6] RFC add blkdev tests v2

2017-04-06 Thread Christoph Hellwig
On Thu, Apr 06, 2017 at 12:19:46PM -0600, Jens Axboe wrote: > We share that goal. The block related tests will have _fewer_ dependencies. > And it'll also be Linux only, so we don't have to worry about cross platform. xfstests effectively has been Linux-only for many years. We've just been to laz

Re: kill req->errors

2017-04-07 Thread Christoph Hellwig
On Thu, Apr 06, 2017 at 04:00:24PM -0400, Konrad Rzeszutek Wilk wrote: > You wouldn't have a git tree to easily test it? Thanks. git://git.infradead.org/users/hch/block.git request-errors Gitweb: http://git.infradead.org/users/hch/block.git/shortlog/refs/heads/request-errors

Re: [PATCH v4 1/6] blk-mq: Make it safe to use RCU to iterate over blk_mq_tag_set.tag_list

2017-04-10 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v4 3/6] blk-mq: Clarify comments in blk_mq_dispatch_rq_list()

2017-04-10 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH v4 2/6] blk-mq: Restart a single queue if tag sets are shared

2017-04-10 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

<    4   5   6   7   8   9   10   11   12   13   >