[dm-devel] [PATCH 05/10] dm: Fix REQ_OP_ZONE_REPORT bio handling

2017-04-20 Thread damien . lemoal
From: Damien Le Moal A REQ_OP_ZONE_REPORT bio is not a medium access command. Its number of sectors indicates the maximum size allowed for the report reply size and not an amount of sectors accessed from the device. REQ_OP_ZONE_REPORT bios should thus not be split

[dm-devel] [PATCH 08/10] dm-linear: Add support for zoned block devices

2017-04-20 Thread damien . lemoal
From: Damien Le Moal Add support for zoned block devices by allowing host-managed zoned block device mapped targets, the remapping of REQ_OP_ZONE_RESET and the post processing (reply remapping) of REQ_OP_ZONE_REPORT. Signed-off-by: Damien Le Moal

[dm-devel] [PATCH 04/10] dm: Fix REQ_OP_ZONE_RESET bio handling

2017-04-20 Thread damien . lemoal
From: Damien Le Moal The REQ_OP_ZONE_RESET bio has no payload and zero sectors. Its position is the only information used to indicate the zone to reset on the device. Due to its zero length, this bio is not cloned and sent to the target through the non-flush case in

[dm-devel] [PATCH 03/10] dm-table: Check block devices zone model compatibility

2017-04-20 Thread damien . lemoal
From: Damien Le Moal When setting the dm device queue limits, several possibilities exists for zoned block devices: 1) The dm target driver may want to expose a different zone model (e.g. host-managed device emulation or regular block device on top of host-managed zoned

Re: [dm-devel] kill req->errors V4

2017-04-20 Thread Jens Axboe
On Thu, Apr 20 2017, Christoph Hellwig wrote: > 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

[dm-devel] [PATCH V2] device-mapper: Convert printks to pr_ macros

2017-04-20 Thread Joe Perches
Using pr_ is the more common logging style. In addition, using the pr_ macros could shrink the kernel image if/when the macros are converted to functions. Miscellanea: o Standardize style and use new macro DM_FMT o Use no_printk in DMDEBUG macros when CONFIG_DM_DEBUG is not #defined

Re: [dm-devel] [resend PATCH v2 11/33] dm: add dax_device and dax_operations support

2017-04-20 Thread Dan Williams
On Mon, Apr 17, 2017 at 12:09 PM, Dan Williams wrote: > Allocate a dax_device to represent the capacity of a device-mapper > instance. Provide a ->direct_access() method via the new dax_operations > indirection that mirrors the functionality of the current direct_access

Re: [dm-devel] [PATCH 22/23] blktrace: remove the unused block_rq_abort tracepoint

2017-04-20 Thread Johannes Thumshirn
On Thu, Apr 20, 2017 at 05:25:58PM +0200, Christoph Hellwig wrote: > On Thu, Apr 20, 2017 at 05:20:56PM +0200, Johannes Thumshirn wrote: > > On Thu, Apr 20, 2017 at 04:03:15PM +0200, Christoph Hellwig wrote: > > > Signed-off-by: Christoph Hellwig > > > --- > > > > Just to be sure

Re: [dm-devel] [PATCH 12/23] dm mpath: don't check for req->errors

2017-04-20 Thread Bart Van Assche
On Thu, 2017-04-20 at 16:03 +0200, Christoph Hellwig wrote: > We'll get all proper errors reported through ->end_io and ->errors will > go away soon. Reviewed-by: Bart Van Assche -- dm-devel mailing list dm-devel@redhat.com

Re: [dm-devel] [PATCH 16/23] blk-mq: remove the error argument to blk_mq_complete_request

2017-04-20 Thread Bart Van Assche
On Thu, 2017-04-20 at 16:03 +0200, Christoph Hellwig wrote: > Now that all drivers that call blk_mq_complete_requests 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. Reviewed-by: Bart Van Assche

Re: [dm-devel] [PATCH 11/23] dm rq: don't pass irrelevant error code to blk_mq_complete_request

2017-04-20 Thread Bart Van Assche
On Thu, 2017-04-20 at 16:03 +0200, Christoph Hellwig wrote: > dm never uses rq->errors, so there is no need to pass an error argument > to blk_mq_complete_request. Reviewed-by: Bart Van Assche -- dm-devel mailing list dm-devel@redhat.com

Re: [dm-devel] [PATCH 23/23] block: remove the errors field from struct request

2017-04-20 Thread Johannes Thumshirn
On Thu, Apr 20, 2017 at 04:03:16PM +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > Reviewed-by: Bart Van Assche > Acked-by: Roger Pau Monné > Reviewed-by: Konrad Rzeszutek Wilk > ---

Re: [dm-devel] [PATCH 02/23] block: remove the blk_execute_rq return value

2017-04-20 Thread Bart Van Assche
On Thu, 2017-04-20 at 16:02 +0200, Christoph Hellwig wrote: > 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. Reviewed-by: Bart Van Assche

Re: [dm-devel] [PATCH 22/23] blktrace: remove the unused block_rq_abort tracepoint

2017-04-20 Thread Christoph Hellwig
On Thu, Apr 20, 2017 at 05:20:56PM +0200, Johannes Thumshirn wrote: > On Thu, Apr 20, 2017 at 04:03:15PM +0200, Christoph Hellwig wrote: > > Signed-off-by: Christoph Hellwig > > --- > > Just to be sure nothings forgotten, does this change need an update for > blktrace as well? I

Re: [dm-devel] [PATCH 22/23] blktrace: remove the unused block_rq_abort tracepoint

2017-04-20 Thread Johannes Thumshirn
On Thu, Apr 20, 2017 at 04:03:15PM +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > --- Just to be sure nothings forgotten, does this change need an update for blktrace as well? -- Johannes Thumshirn Storage

Re: [dm-devel] [PATCH 16/23] blk-mq: remove the error argument to blk_mq_complete_request

2017-04-20 Thread Johannes Thumshirn
On Thu, Apr 20, 2017 at 04:03:09PM +0200, Christoph Hellwig wrote: > Now that all drivers that call blk_mq_complete_requests 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

Re: [dm-devel] [PATCH 14/23] mtip32xx: add a status field to struct mtip_cmd

2017-04-20 Thread Johannes Thumshirn
On Thu, Apr 20, 2017 at 04:03:07PM +0200, Christoph Hellwig wrote: > Instead of using req->errors, which will go away. > > Signed-off-by: Christoph Hellwig > --- Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn

Re: [dm-devel] [PATCH 12/23] dm mpath: don't check for req->errors

2017-04-20 Thread Johannes Thumshirn
On Thu, Apr 20, 2017 at 04:03:05PM +0200, Christoph Hellwig wrote: > We'll get all proper errors reported through ->end_io and ->errors will > go away soon. > > Signed-off-by: Christoph Hellwig > --- Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn

Re: [dm-devel] [PATCH 10/23] null_blk: don't pass always-0 req->errors to blk_mq_complete_request

2017-04-20 Thread Johannes Thumshirn
On Thu, Apr 20, 2017 at 04:03:03PM +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > --- Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de

Re: [dm-devel] [PATCH 11/23] dm rq: don't pass irrelevant error code to blk_mq_complete_request

2017-04-20 Thread Johannes Thumshirn
On Thu, Apr 20, 2017 at 04:03:04PM +0200, Christoph Hellwig wrote: > 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 > --- Reviewed-by: Johannes Thumshirn -- Johannes

Re: [dm-devel] [PATCH 01/23] pd: don't check blk_execute_rq return value.

2017-04-20 Thread Johannes Thumshirn
On Thu, Apr 20, 2017 at 04:02:54PM +0200, Christoph Hellwig wrote: > The driver never sets req->errors, so blk_execute_rq will always return 0. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Bart Van Assche > --- Reviewed-by: Johannes Thumshirn

[dm-devel] [PATCH 02/23] block: remove the blk_execute_rq return value

2017-04-20 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 Reviewed-by: Johannes Thumshirn

[dm-devel] [PATCH 04/23] nvme: split nvme status from block req->errors

2017-04-20 Thread Christoph Hellwig
We want our own clearly defined error field for NVMe passthrough commands, and the request errors field is going away in its current form. Just store the status and result field in the nvme_request field from hardirq completion context (using a new helper) and then generate a Linux errno for the

[dm-devel] [PATCH 09/23] loop: zero-fill bio on the submitting cpu

2017-04-20 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 Reviewed-by: Ming Lei --- drivers/block/loop.c | 30

[dm-devel] [PATCH 03/23] nvme-fc: fix status code handling in nvme_fc_fcpio_done

2017-04-20 Thread Christoph Hellwig
nvme_complete_async_event expects the little endian status code including the phase bit, and a new completion handler I plan to introduce will do so as well. Change the status variable into the little endian format with the phase bit used in the NVMe CQE to fix / enable this. Signed-off-by:

[dm-devel] [PATCH 11/23] dm rq: don't pass irrelevant error code to blk_mq_complete_request

2017-04-20 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

[dm-devel] [PATCH 06/23] virtio: fix spelling of virtblk_scsi_request_done

2017-04-20 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche --- drivers/block/virtio_blk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/virtio_blk.c

[dm-devel] [PATCH 12/23] dm mpath: don't check for req->errors

2017-04-20 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

[dm-devel] [PATCH 07/23] virtio_blk: don't use req->errors

2017-04-20 Thread Christoph Hellwig
Remove passing req->errors (which at that point is always 0) to blk_mq_complete_request, and rely on the virtio status code for the serial number passthrough request. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn ---

[dm-devel] [PATCH 13/23] nbd: don't use req->errors

2017-04-20 Thread Christoph Hellwig
Add a nbd-specific field instead. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik --- drivers/block/nbd.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index

[dm-devel] [PATCH 01/23] pd: don't check blk_execute_rq return value.

2017-04-20 Thread Christoph Hellwig
The driver never sets req->errors, so blk_execute_rq will always return 0. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche --- drivers/block/paride/pd.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

[dm-devel] [PATCH 23/23] block: remove the errors field from struct request

2017-04-20 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Acked-by: Roger Pau Monné Reviewed-by: Konrad Rzeszutek Wilk --- block/blk-core.c | 14 +- block/blk-exec.c

[dm-devel] [PATCH 14/23] mtip32xx: add a status field to struct mtip_cmd

2017-04-20 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

[dm-devel] kill req->errors V4

2017-04-20 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

[dm-devel] [PATCH 17/23] blk-mq: simplify __blk_mq_complete_request

2017-04-20 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 | 25 - 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index

[dm-devel] [PATCH 19/23] floppy: switch from req->errors to req->error_count

2017-04-20 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 @@

[dm-devel] [PATCH 21/23] swim3: remove (commented out) printing of req->errors

2017-04-20 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

[dm-devel] [PATCH 16/23] blk-mq: remove the error argument to blk_mq_complete_request

2017-04-20 Thread Christoph Hellwig
Now that all drivers that call blk_mq_complete_requests 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| 15

[dm-devel] [PATCH 15/23] xen-blkfront: don't use req->errors

2017-04-20 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: Christoph

[dm-devel] [PATCH 20/23] ataflop: switch from req->errors to req->error_count

2017-04-20 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 +++

[dm-devel] [PATCH 22/23] blktrace: remove the unused block_rq_abort tracepoint

2017-04-20 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

[dm-devel] [PATCH 10/23] null_blk: don't pass always-0 req->errors to blk_mq_complete_request

2017-04-20 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 e79e3d24e229..0ca4aa34edb9 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c

[dm-devel] [PATCH 08/23] scsi: introduce a result field in struct scsi_request

2017-04-20 Thread Christoph Hellwig
This passes on the scsi_cmnd result field to users of passthrough requests. Currently we abuse req->errors for this purpose, but that field will go away in its current form. Note that the old IDE code abuses the errors field in very creative ways and stores all kinds of different values in it.

Re: [dm-devel] dm-era: metadata reuse after reboot possible?

2017-04-20 Thread Markus Hentsch
Dear Somu, thanks for your quick response! I applied your patch to the 4.4 kernel of a Ubuntu 16.04.2 VM and can now confirm that the dm-era metadata survived every subsequent reboot so far. Thank you! Best regards, Markus Hentsch Cloud Technologies On Apr 19, 2017 at 18:18 Somasundaram

Re: [dm-devel] [resend PATCH v2 08/33] dcssblk: add dax_operations support

2017-04-20 Thread Gerald Schaefer
On Mon, 17 Apr 2017 12:09:32 -0700 Dan Williams wrote: > Setup a dax_dev to have the same lifetime as the dcssblk block device > and add a ->direct_access() method that is equivalent to > dcssblk_direct_access(). Once fs/dax.c has been converted to use > dax_operations

[dm-devel] [PATCH 05/23] nvme: make nvme_error_status private

2017-04-20 Thread Christoph Hellwig
Currently it's used by the lighnvm passthrough ioctl, but we'd like to make it private in preparation of block layer specific error code. Lighnvm already returns the real NVMe status anyway, so I think we can just limit it to returning -EIO for any status set. This will need a careful audit from