[PATCH 2/8] block: Fix declaration of blk-mq scheduler functions

2017-09-01 Thread Damien Le Moal
external scheduler modules. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- block/blk-mq-sched.h | 7 --- include/linux/blk-mq.h | 10 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h index 9267d0

[PATCH 5/8] scsi: sd_zbc: Fix sd_zbc_read_zoned_characteristics()

2017-09-01 Thread Damien Le Moal
er.kernel.org> Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd_zbc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index 810377007665..0e6b5f5d14e7 100644 --- a/drivers/scsi/sd_zbc.c +++ b

[PATCH 4/8] scsi: sd_zbc: Reorganize and cleanup

2017-09-01 Thread Damien Le Moal
and use_10_for_rw assignment and simplify nr_zones calculation. Finally, use the min() macro sd_zbc_check_zone_size() to get a report zone reply size instead of the open coded version. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd.c | 1 + drivers/scsi/sd.h

[PATCH 1/8] block: Fix declaration of blk-mq debugfs functions

2017-09-01 Thread Damien Le Moal
the definition of the blk_mq_debugfs_attr strcture to allow scheduler modules outside of block to define debugfs attributes. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- block/blk-mq-debugfs.h | 14 -- include/linux/blk-mq.h | 20 2 files chang

[PATCH 0/8] blk-mq/scsi-mq support for ZBC disks

2017-09-01 Thread Damien Le Moal
for disks accessed through scsi-mq. - Patch 8 introduces the zoned scheduler. Comments are as always very much appreciated. Thank you. Damien Le Moal (8): block: Fix declaration of blk-mq debugfs functions block: Fix declaration of blk-mq scheduler functions scsi: sd_zbc: Move ZBC de

Re: [PATCH V2 1/2] scsi: sd: Fix sd_config_write_same()

2017-09-01 Thread Damien Le Moal
(logical_block_size >> 9)); > > ALIGN_DOWN(sdkp->max_ws_blocks, sdkp->physical_block_size)? Sure. But let's use the same unit then :) sdkp->max_ws_blocks = ALIGN_DOWN(sdkp->max_ws_blocks, bytes_to_logical(sdkp->device, sdkp->physical_block_size)); Isn't it ? Do you want me to resend ? Thank you. -- Damien Le Moal, Western Digital

[PATCH V2 2/2] scsi: sd: Use sectors_to_logical()

2017-08-31 Thread Damien Le Moal
Replace open coded conversions. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index e7d1eed4afa7..84fab90fe2cb 100644 --- a/drivers/scs

[PATCH V2 1/2] scsi: sd: Fix sd_config_write_same()

2017-08-31 Thread Damien Le Moal
disks. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd.c | 21 + 1 file changed, 21 insertions(+) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 6549e5ce09ca..e7d1eed4afa7 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -898,6 +

[PATCH V2 0/2] sd fixes and cleanup

2017-08-31 Thread Damien Le Moal
(__blkdev_issue_write_same() and __blkdev_issue_write_zeroes()). Please let me know if you prefer a block layer solution. The second patch does not introduce functional changes. As always, comments are welcome ! changes from V1: * Removed useless addition of blank line an indentaion change in first patch. Damien Le

[PATCH 2/2] scsi: sd: Use sectors_to_logical()

2017-08-31 Thread Damien Le Moal
Replace open coded conversions. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index f6c205200c5b..a32bf434cb3d 100644 --- a/drivers/scs

[PATCH 1/2] scsi: sd: Fix sd_config_write_same()

2017-08-31 Thread Damien Le Moal
disks. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd.c | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 6549e5ce09ca..f6c205200c5b 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scs

[PATCH 0/2] sd fixes and cleanup

2017-08-31 Thread Damien Le Moal
(__blkdev_issue_write_same() and __blkdev_issue_write_zeroes()). Please let me know if you prefer a block layer solution. The second patch does not introduce functional changes. As always, comments are welcome ! Damien Le Moal (2): scsi: sd: Fix sd_config_write_same() scsi: sd: Use sectors_to_logical() drivers

Re: [GIT PULL] SCSI fixes for 4.13-rc6

2017-08-23 Thread Damien Le Moal
re progressing, we hopefully should be able to get Bart's pacth back in soon (this week ?) and remove the mq dispatch deadlock. Best regards. -- Damien Le Moal, Western Digital Research

Re: [PATCH] scsi: sd_zbc: Disable zoned block devices with scsi-mq

2017-08-17 Thread Damien Le Moal
On 8/18/17 00:01, Bart Van Assche wrote: > On Thu, 2017-08-17 at 21:19 +0900, Damien Le Moal wrote: >> On 8/17/17 16:59, Christoph Hellwig wrote: >>> On Thu, Aug 17, 2017 at 11:45:50AM +0900, Damien Le Moal wrote: >>>> blk-mq may not maintain write requests o

Re: [PATCH] scsi: sd_zbc: Disable zoned block devices with scsi-mq

2017-08-17 Thread Damien Le Moal
On 8/17/17 21:19, Damien Le Moal wrote: > > > On 8/17/17 16:59, Christoph Hellwig wrote: >> On Thu, Aug 17, 2017 at 11:45:50AM +0900, Damien Le Moal wrote: >>> blk-mq may not maintain write requests order at dispatch time. So host >>> managed drives will no

Re: [PATCH] scsi: sd_zbc: Disable zoned block devices with scsi-mq

2017-08-17 Thread Damien Le Moal
On 8/17/17 16:59, Christoph Hellwig wrote: > On Thu, Aug 17, 2017 at 11:45:50AM +0900, Damien Le Moal wrote: >> blk-mq may not maintain write requests order at dispatch time. So host >> managed drives will not reliably work. Worse, potential reordering of >> write requests

[PATCH] scsi: sd_zbc: Disable zoned block devices with scsi-mq

2017-08-16 Thread Damien Le Moal
, do not support zoned block devices with scsi-mq by showing a 0 LBA capacity disk. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd_zbc.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index 8aa547

Re: [PATCH] Revert "scsi-mq: Always unprepare before requeuing a request"

2017-08-16 Thread Damien Le Moal
Martin, On 8/17/17 09:41, Damien Le Moal wrote: > Martin, > > On 8/17/17 09:11, Martin K. Petersen wrote: >> >> Bart, >> >>> For an unknown reason this patch causes the boot process to hang on >>> PowerPC systems: >> >> OK, dropped it fr

Re: [PATCH] Revert "scsi-mq: Always unprepare before requeuing a request"

2017-08-16 Thread Damien Le Moal
ion of zoned block devices with scsi-mq (do not create the block devices) (2) may actually be the better solution for now until I get a fix for blk-mq. Thoughts ? Best regards. -- Damien Le Moal, Western Digital

Re: [PATCH] sd_zbc: Write unlock zone from sd_uninit_cmnd()

2017-08-09 Thread Damien Le Moal
On 8/10/17 11:14, Damien Le Moal wrote: > Bart, > > On 8/10/17 00:24, Bart Van Assche wrote: >> On Wed, 2017-08-09 at 14:15 +0900, Damien Le Moal wrote: >>> Overall, yes, that is possible. However, considering only write commands >>> to a single zone, s

Re: [PATCH] sd_zbc: Write unlock zone from sd_uninit_cmnd()

2017-08-09 Thread Damien Le Moal
Bart, On 8/10/17 00:24, Bart Van Assche wrote: > On Wed, 2017-08-09 at 14:15 +0900, Damien Le Moal wrote: >> Overall, yes, that is possible. However, considering only write commands >> to a single zone, since at any time only one command is dequeued (the >> one holding t

Re: [PATCH] sd_zbc: Write unlock zone from sd_uninit_cmnd()

2017-08-08 Thread Damien Le Moal
On 8/9/17 13:15, Bart Van Assche wrote: > On Wed, 2017-08-09 at 13:07 +0900, Damien Le Moal wrote: >> >> On 8/9/17 12:57, Bart Van Assche wrote: >>> On Wed, 2017-08-09 at 11:47 +0900, Damien Le Moal wrote: >>>> On 8/9/17 11:19, Damien Le Moal wrote: >>

Re: [PATCH] sd_zbc: Write unlock zone from sd_uninit_cmnd()

2017-08-08 Thread Damien Le Moal
On 8/9/17 12:57, Bart Van Assche wrote: > On Wed, 2017-08-09 at 11:47 +0900, Damien Le Moal wrote: >> On 8/9/17 11:19, Damien Le Moal wrote: >>> On 8/9/17 00:07, Bart Van Assche wrote: >>>> On Tue, 2017-08-08 at 13:17 +0900, Damien Le Moal wrote: >>>&

[PATCH V2] sd_zbc: Write unlock zone from sd_uninit_cmnd()

2017-08-08 Thread Damien Le Moal
(). Acquisition of a zone lock by a write command is indicated using the new command flag SCMD_ZONE_WRITE_LOCK. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com> --- Changes from V1:

Re: [PATCH] sd_zbc: Write unlock zone from sd_uninit_cmnd()

2017-08-08 Thread Damien Le Moal
Bart, On 8/9/17 11:19, Damien Le Moal wrote: > Bart, > > On 8/9/17 00:07, Bart Van Assche wrote: >> On Tue, 2017-08-08 at 13:17 +0900, Damien Le Moal wrote: >>> Releasing the write lock of a zone

Re: [PATCH] sd_zbc: Write unlock zone from sd_uninit_cmnd()

2017-08-08 Thread Damien Le Moal
Bart, On 8/9/17 00:07, Bart Van Assche wrote: > On Tue, 2017-08-08 at 13:17 +0900, Damien Le Moal wrote: >> Releasing the write lock of a zone when the write commnand that > >

[PATCH] sd_zbc: Write unlock zone from sd_uninit_cmnd()

2017-08-07 Thread Damien Le Moal
sd_zbc_write_unlock_zone() from that function for write requests that acquired a zone lock. Acquisition of a zone lock by a write command is indicated using the new command flag SCMD_ZONE_WRITE_LOCK. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Reviewed-by: Christoph Hellwig <h.

Re: [PATCH 1/2] block: Zoned block device single-threaded submission

2017-08-07 Thread Damien Le Moal
nse to me. What do you think ? Of course, I may be missing something really simple to solve the problem in blk-mq. I would be happy to tackle the implementation & testing if someone has an idea. Best regards. -- Damien Le Moal, Western Digital

Re: [PATCH] scsi-mq: Always unprepare before requeuing a request

2017-08-04 Thread Damien Le Moal
> Fixes: commit d285203cf647 ("scsi: add support for a blk-mq based I/O path.") > Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> > Cc: Christoph Hellwig <h...@lst.de> > Cc: Hannes Reinecke <h...@suse.com> > Cc: Damien Le Moal <damien.lem...@wdc.

[PATCH 0/2 V2] Zoned block device support fixes

2017-08-04 Thread Damien Le Moal
. The second patch requires the patch 2f2d7c92dda "scsi-mq: Always unprepare before requeuing a request" sent by Bart. Damien Le Moal (1): sd_zbc: Write unlock zone from sd_uninit_cmnd() Hannes Reinecke (1): block: Zoned block device single-threaded submission block/blk-core.c

[PATCH 1/2] block: Zoned block device single-threaded submission

2017-08-04 Thread Damien Le Moal
k: add flag for single-threaded submission" in the tree https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/log/?h=zac.v3 Authorship thus goes to Hannes. Signed-off-by: Hannes Reinecke <h...@suse.de> Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- block/bl

[PATCH 2/2] sd_zbc: Write unlock zones from sd_uninit_cmnd()

2017-08-04 Thread Damien Le Moal
sd_zbc_write_unlock_zone() from that function for write requests that acquired a zone lock. Acquisition of a zone lock by a write command is indicated using the new command flag SCMD_ZONE_WRITE_LOCK. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd.c| 3 +++ driver

[PATCH 1/2] block: Zoned block device single-threaded submission

2017-08-01 Thread Damien Le Moal
k: add flag for single-threaded submission" in the tree https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/log/?h=zac.v3 Authorship thus goes to Hannes. Signed-off-by: Hannes Reinecke <h...@suse.de> Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- block/blk-core.c

[PATCH 2/2] sd_zbc: Disable zone locking with scsi-mq enabled

2017-08-01 Thread Damien Le Moal
with scsi-mq enabled for now, unless the drive users limit the number of writes per sequential zone to 1 at all times. Both f2fs and dm-zoned do not do this and so cannot be used safely with scsi-mq enabled. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd_zbc.c | 7

[PATCH 0/2] Zoned block device support fixes

2017-08-01 Thread Damien Le Moal
asynchronous (queued) write BIO issuing pattern with scsi-mq enabled for now. Damien Le Moal (1): sd_zbc: Disable zone locking with scsi-mq enabled Hannes Reinecke (1): block: Zoned block device single-threaded submission block/blk-core.c | 7 +++ drivers/scsi/sd_zbc.c | 7 ++- 2

Re: [PATCH] tcmu: Fix possbile memory leak when recalculating the cmd base size

2017-07-11 Thread Damien Le Moal
ov_cnt = 0;   iov++;   ret = scatter_data_area(udev, tcmu_cmd,   se_cmd->t_bidi_data_sg, @@ -879,8 +877,8 @@ tcmu_queue_cmd_ring(struct tcmu_cmd *tcmu_cmd)   pr_err("tcmu: alloc and scatter bidi data failed\n");   return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;   } - entry->req.iov_bidi_cnt = iov_cnt;   } + entry->req.iov_bidi_cnt = iov_cnt;     /*    * Recalaulate the command's base size and size according --  Best regards. -- Damien Le Moal Western Digital

Re: [PATCH] tcmu: Fix possible overflow for memcpy address in iovec

2017-07-11 Thread Damien Le Moal
; > >     copy_bytes); > > > > I was just looking at this patch and about to try to see if it fixes my > > problem... It cannot hurt. Trying... > > Hi Damien, > > Please test another patch, I think that one maybe fix this. void * pointer arithmetic is OK and equivalent to unsigned long. So I do not think this actually fixes anything and could be rewritten more simply as to += offset; and from += offset. And that compiles without a warning and there are no complaints from sparse. Cheers. -- Damien Le Moal Western Digital

Re: [PATCH] tcmu: Fix possible overflow for memcpy address in iovec

2017-07-11 Thread Damien Le Moal
> + to = (void *)((unsigned long)to + offset); >>> >>> if (*iov_cnt != 0 && >>> to_offset == iov_tail(udev, *iov)) { >>> @@ -510,7 +510,7 @@ static void gather_data_area(struct tcmu_dev *udev, >>> struct tcmu_cmd *cmd, >>> copy_bytes = min_t(size_t, sg_remaining, >>> block_remaining); >>> offset = DATA_BLOCK_SIZE - block_remaining; >>> - from = (void *)(unsigned long)from + offset; >>> + from = (void *)((unsigned long)from + offset); >>> tcmu_flush_dcache_range(from, copy_bytes); >>> memcpy(to + sg->length - sg_remaining, from, >>> copy_bytes); I was just looking at this patch and about to try to see if it fixes my problem... It cannot hurt. Trying... -- Damien Le Moal, Western Digital

Re: [PATCH 4/5] target: user: Fix sense data handling

2017-07-10 Thread Damien Le Moal
Mike, On 7/11/17 02:26, Mike Christie wrote: > On 07/10/2017 12:36 AM, Damien Le Moal wrote: >> Nicholas, Mike, >> >> On 7/7/17 15:05, Nicholas A. Bellinger wrote: >>> Everything including MNC's #1-6 and your #1-2 be pushed to >>> target-pending/for-next s

Re: [PATCH 4/5] target: user: Fix sense data handling

2017-07-09 Thread Damien Le Moal
thing is fine, including case (4). A diff of the 2 versions of drivers/target/target_core_user.c did not reveal anything obvious that could result in this... It does look like a race condition on the session command or some memory corruption/bad pointer. Any idea ? Thanks you. Best regards. --

Re: [PATCH 4/5] target: user: Fix sense data handling

2017-07-07 Thread Damien Le Moal
afternoon here in Japan. My brain is slowing down for the weekend :) Cheers. -- Damien Le Moal, Western Digital

Re: [PATCH 4/5] target: user: Fix sense data handling

2017-07-06 Thread Damien Le Moal
Nicholas, On 7/7/17 13:50, Nicholas A. Bellinger wrote: > Hey MNC & Co, > > On Wed, 2017-06-28 at 12:44 -0500, Mike Christie wrote: >> On 06/28/2017 12:58 AM, Damien Le Moal wrote: >>> If the user request handler completed the request with a CHECK CONDITION >&g

Re: [PATCH 4/5] target: user: Fix sense data handling

2017-06-28 Thread Damien Le Moal
On 6/29/17 02:44, Mike Christie wrote: > On 06/28/2017 12:58 AM, Damien Le Moal wrote: >> If the user request handler completed the request with a CHECK CONDITION >> status, tcmu_handle_completion() copies the command entry sense data >> into the session request structur

Re: [PATCH 0/5] target: Zoned block device support and bug fixes

2017-06-28 Thread Damien Le Moal
s and >> result in the emulated handler passing libzbc ZBC specification conformance >> tests. >> >> (Note: the ZBC emulation tcmu-runner handler will be submitted to the >> tcmu-runner project on github) >> >> Please consider these patches for inclusion

[PATCH 4/5] target: user: Fix sense data handling

2017-06-28 Thread Damien Le Moal
in the copy being a no-op and failure to propagate the sense data back to the initiator. To fix this, properly set the session command sense data length and also set the session command SCF_TRANSPORT_TASK_SENSE flag to indicate that the command has valid sense data. Signed-off-by: Damien Le Moal

[PATCH 3/5] target: pscsi: Fix sense data handling

2017-06-28 Thread Damien Le Moal
. However, in pscsi_req_done(), the sense data is retreived from the request after calling target_complete_cmd(), which result in the sense data always conatining zeroes. Simply fix this by copying the sense data before calling target_complete_cmd(). Signed-off-by: Damien Le Moal <damien.lem...@wdc.

[PATCH 0/5] target: Zoned block device support and bug fixes

2017-06-28 Thread Damien Le Moal
on github) Please consider these patches for inclusion with kernel 4.13. Damien Le Moal (5): target: Use macro for WRITE_VERIFY_xx operation codes target: pscsi: Introduce TYPE_ZBC support target: pscsi: Fix sense data handling target: user: Fix sense data handling target: core: Fix failed

[PATCH 2/5] target: pscsi: Introduce TYPE_ZBC support

2017-06-28 Thread Damien Le Moal
TYPE_ZBC host managed zoned block devices are also block devices despite the non-standard device type (14h). Handle them similarly to regular TYPE_DISK devices. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/target/target_core_pscsi.c | 17 +++-- 1 file chang

[PATCH 1/5] target: Use macro for WRITE_VERIFY_xx operation codes

2017-06-28 Thread Damien Le Moal
Add WRITE_VERIFY_32 definition to scsi prototypes and use this macro definition isntead of the hard coded value. Same for the already defined WRITE_VERIFY_16 command code. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/target/target_core_device.c | 4 ++-- includ

[PATCH 5/5] target: core: Fix failed command sense data handling

2017-06-28 Thread Damien Le Moal
RT_TASK_SENSE flag test out of the transport_complete defined conditional. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/target/target_core_transport.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_transport.

Re: [PATCH] nvme/scsi: Consider LBA format in IO splitting calculation

2017-04-24 Thread Damien Le Moal
s patch, which is a real > bug fix. Thank you for the clarification. I will try to send something later. Best regards. -- Damien Le Moal, Western Digital

Re: [PATCH] nvme/scsi: Consider LBA format in IO splitting calculation

2017-04-24 Thread Damien Le Moal
in units of 512b blocks. > > Reviewed-by: Jens Axboe <ax...@fb.com> May be replace 9 with SECTOR_SHIFT ? Jens, I just realized that this macro is defined in linux/device-mapper.h, which does not seem like to best place to have it. Why not blkdev.h ? Any particular reason ? Thi

Re: [PATCH v2 3/7] sd: Cleanup sd_done sense data handling

2017-04-24 Thread Damien Le Moal
ases, which are the only commands that can lead to hitting that "else" part in the sense data processing. I may be missing something, but I think that that assignment is redundant. Best regards. -- Damien Le Moal, Ph.D. Sr. Manager, System Software Research Group, Western Digital Corporat

Re: [PATCH 3/9] sd: Remove unecessary variable in sd_done()

2017-04-23 Thread Damien Le Moal
things like this. However, a patch to change existing code fails > the net benefit test. OK. Let's drop this patch then. Thank you for the review. -- Damien Le Moal, Western Digital

Re: [PATCH 5/9] sd: Cleanup sd_done sense data handling

2017-04-23 Thread Damien Le Moal
o mention that in the commit message. (for result != 0, good_bytes is already set to 0, so that assignment is not necessary). Will resend. -- Damien Le Moal, Ph.D. Sr. Manager, System Software Research Group, Western Digital Corporation damien.lem...@wdc.com (+81) 0466-98-3593 (ext. 513593) 1 kirihara-cho, Fujisawa, Kanagawa, 252-0888 Japan www.wdc.com, www.hgst.com

Re: [PATCH 2/9] sd: Fix functions description

2017-04-23 Thread Damien Le Moal
argument of foobar. * * Longer description of foobar. * * Return: Description of return value of foobar. */ If that is wrong/unnecessary, then I will rewrite that patch to only limit its scope to the argument name fixes. Best regards. -- Damien Le Moal, Western Digital

Re: [PATCH 1/9] sd: Remove white space before EOL

2017-04-23 Thread Damien Le Moal
enance if that kind of trivial cleanup cannot go in... (not to mention that checkpatch keep warning about white spaces in sd.c if a patch touches something near one of those multiple lines with white spaces). But fine, let's drop it. -- Damien Le Moal, Western Digital

Re: [PATCH 9/9] sd_zbc: Do not write lock zones for reset

2017-04-23 Thread Damien Le Moal
nals a bug to the user. For case (3), that may also be intentional by the user (not recommended though). So I am afraid that a warning may trigger false-positives and may not be that useful in the end. Best regards. -- Damien Le Moal, Ph.D. Sr. Manager, System Software Research Group, Weste

Re: [PATCH 7/9] sd_zbc: Rename sd_zbc_setup_write_cmnd

2017-04-23 Thread Damien Le Moal
value is zero, so we assume the whole buffer transferred >> */ > > Is this whitespace-only change useful? Otherwise this patch looks fine > to me. Hence: > > Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> Ooops... No it is not. I will resend a v2. Thanks. -- Damien Le Moal, Western Digital

Re: [PATCH 6/9] scsi: Improve scsi_get_sense_info_fld

2017-04-23 Thread Damien Le Moal
e to repost this patch please address the checkpatch complaints > of the following category triggered by the above declaration: > > ERROR: "foo * bar" should be "foo *bar" > > Otherwise this patch looks fine to me. Hence: > > Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com> OK. Will do. -- Damien Le Moal, Western Digital

Re: [PATCH 0/3] Separate zone requests from medium access requests

2017-03-01 Thread Damien Le Moal
Martin, On 3/1/17 12:21, Martin K. Petersen wrote: >>>>>> "Damien" == Damien Le Moal <damien.lem...@wdc.com> writes: > > Damien, > > Damien> The problem remains that the mpt3sas driver needs fixing. As you > Damien> suggest, we can do that

[PATCH v6] sd: Check for unaligned partial completion

2017-03-01 Thread Damien Le Moal
ch case so that the report and reset zone commands are ignored. In addition, as sd_done() is not called for passthrough requests, resid corrections are not done as intended by the initial mpt3sas patch. Fixes: f2e767bb5d6e ("mpt3sas: Force request partial completion alignment") Signed-off-by: Damien

Re: [PATCH 0/3] Separate zone requests from medium access requests

2017-02-28 Thread Damien Le Moal
() defined. We could move that to include/scsi/scsi.h (or scsi_proto.h) and use it in place of blk_rq_accesses_medium() in the mpt3sas driver to not force unaligned resid corrections for zone commands. Would that be acceptable ? Best regards. -- Damien Le Moal, Ph.D. Sr. Manager, System Software Resea

[PATCH 0/3] Separate zone requests from medium access requests

2017-02-28 Thread Damien Le Moal
This series introduces blk_rq_accesses_medium(), which is equivalent to !blk_rq_is_passthrough() minus the zone request operations REQ_OP_ZONE_REPORT and REQ_OP_ZONE_RESET. This new helper allows avoiding problems due to the non-standard nature of these commands (report zones does no operate on

[PATCH 1/3] block: Introduce blk_rq_accesses_medium()

2017-02-28 Thread Damien Le Moal
From: Bart Van Assche A medium access request is defined as an internal regular request that operates on a whole number of logical blocks of the storage medium. These include REQ_OP_READ, REQ_OP_WRITE, REQ_OP_FLUSH, REQ_OP_DISCARD, REQ_OP_SECURE_ERASE,

[PATCH 2/3] block: Separate zone requests from medium access requests

2017-02-28 Thread Damien Le Moal
From: Bart Van Assche Use blk_rq_accesses_medium() instead of !blk_rq_is_passthrough() to ensure that code that is intended for normal medium access requests, e.g. DISCARD, READ and WRITE requests, is not applied to REQ_OP_ZONE_REPORT requests nor to REQ_OP_ZONE_RESET

[PATCH 2/2] sd_zbc: Remove superfluous assignments

2017-02-28 Thread Damien Le Moal
initialized in sd_zbc_read_zones() but that initialization is not necessary. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd_zbc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index 789c970..cf2c6a7 100644

[PATCH 0/2] Improve ZBC integration

2017-02-28 Thread Damien Le Moal
mands"). The second patch, from Bart, cleans up unused variable assignments in sd_zbc_read_zones(). Bart Van Assche (1): sd_zbc: Remove superfluous assignments Damien Le Moal (1): sd: Rework ZBC integration drivers/scsi/sd.c | 36 ++--- drivers/scsi/sd.h | 11 +++--- dr

[PATCH 1/2] sd: Rework ZBC integration

2017-02-28 Thread Damien Le Moal
eventual problems with bogus hardware. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd.c | 36 ++ drivers/scsi/sd.h | 11 +++--- drivers/scsi/sd_zbc.c | 101 +- 3 files changed, 84 insertions(

[PATCH 3/3] mpt3sas: Do not check resid for non medium access commands

2017-02-28 Thread Damien Le Moal
From: Bart Van Assche Commit f2e767bb5d6e ("mpt3sas: Force request partial completion alignment") introduced a forced alignment of resid to the device logical block size to fix bogus HBA firmware sometimes returning an unaligned value. This fix however did not

Re: [PATCH v5] sd: Check for unaligned partial completion

2017-02-22 Thread Damien Le Moal
Martin, On 2/22/17 13:24, Martin K. Petersen wrote: >>>>>> "Damien" == Damien Le Moal <damien.lem...@wdc.com> writes: > > Damien, > > Damien> I think we would still need the check for REQ_TYPE_FS to avoid > Damien> interfering with SG_I

Re: [PATCH v5] sd: Check for unaligned partial completion

2017-02-22 Thread Damien Le Moal
Martin, On 2/23/17 13:44, Damien Le Moal wrote: > I do not see the problematic resid correction code in the mpt3sas driver > in 4.11/scsi-queue branch. Is this expected ? Did the mpt3sas driver > updates removed it ? > > It looks like that branch is based on 4.10.0-rc2. The mpt3sa

Re: [PATCH v5] sd: Check for unaligned partial completion

2017-02-21 Thread Damien Le Moal
lly in favor of just patching mpt3sas since it's clearly > broken (a disk can't write a partial sector). But I don't think a device > driver should know how to special case REPORT ZONES or similar. That's > clearly SBC/ZBC territory, so I prefer the sd_completed_bytes() > approach. OK.

Re: [PATCH v5] sd: Check for unaligned partial completion

2017-02-20 Thread Damien Le Moal
uest operation may map to different commands depending on the device type (e.g. REQ_OP_DISCARD which can become unmap or write same in SCSI). Martin, Which approach do you prefer ? Keeping everything contained to mpt3sas (so basically just fixing the problematic patch), or cleaning up ever

Re: [PATCH v5] sd: Check for unaligned partial completion

2017-02-20 Thread Damien Le Moal
Martin, On 2/21/17 11:35, Martin K. Petersen wrote: >>>>>> "Damien" == Damien Le Moal <damien.lem...@wdc.com> writes: > > Hi Damien, > > Damien> Move the partial completion alignement check of mpt3sas to a > Damien> generic imple

Re: [PATCH v5] sd: Check for unaligned partial completion

2017-02-20 Thread Damien Le Moal
Bart, On 2/21/17 02:34, Bart Van Assche wrote: > On 02/16/2017 04:20 PM, Damien Le Moal wrote: >> Move the partial completion alignement check of mpt3sas to a generic >> implementation in sd_done so that the check ignores REQ_TYPE_FS >> requests with special payload size han

Re: [PATCH v5] sd: Check for unaligned partial completion

2017-02-19 Thread Damien Le Moal
so a huge chunk of the market). Is there any possibility to get this added to 4.10.0 ? Best regards. -- Damien Le Moal, Ph.D. Sr. Manager, System Software Research Group, Western Digital Corporation damien.lem...@wdc.com (+81) 0466-98-3593 (ext. 513593) 1 kirihara-cho, Fujisawa, Kanagawa,

[PATCH v5] sd: Check for unaligned partial completion

2017-02-16 Thread Damien Le Moal
also being properly aligned. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Fixes: f2e767bb5d6e ("mpt3sas: Force request partial completion alignment") --- Changes from v4: - As suggested by Bart, make sure resid does not exceed good_bytes - Use sd_printk for message instead

Re: [PATCH v4] sd: Check for unaligned partial completion

2017-02-15 Thread Damien Le Moal
Bart, On 2/16/17 12:28, Bart Van Assche wrote: > On Thu, 2017-02-16 at 11:52 +0900, Damien Le Moal wrote: >> Thanks for the pointers. I checked libiscsi tests. And from what is done >> there, it seems to me that it is basically impossible to distinguished >> between a bu

Re: [PATCH v4] sd: Check for unaligned partial completion

2017-02-15 Thread Damien Le Moal
this late in the RC cycle. Should I keep the fix in its current place and defer the move to sd_completed_bytes to a later patch for 4.11 ? > Also, I am no fan of perpetuating the arcane SCSI logging stuff now that > we have tracing. So just make it a regular sd_printk(). Sure, will do. Thank you. --

Re: [PATCH v4] sd: Check for unaligned partial completion

2017-02-15 Thread Damien Le Moal
Bart, On 2/16/17 11:52, Damien Le Moal wrote: > Bart, > > On 2/16/17 10:10, Bart Van Assche wrote: >> On Thu, 2017-02-16 at 09:54 +0900, Damien Le Moal wrote: >>> On 2/16/17 01:42, Bart Van Assche wrote: >>>> An additional concern: what if the size of the Da

Re: [PATCH v4] sd: Check for unaligned partial completion

2017-02-15 Thread Damien Le Moal
Bart, On 2/16/17 10:10, Bart Van Assche wrote: > On Thu, 2017-02-16 at 09:54 +0900, Damien Le Moal wrote: >> On 2/16/17 01:42, Bart Van Assche wrote: >>> An additional concern: what if the size of the Data-Out buffer is not a >>> multiple of the logical block si

Re: [PATCH v4] sd: Check for unaligned partial completion

2017-02-15 Thread Damien Le Moal
Bart, On 2/16/17 01:42, Bart Van Assche wrote: > On Wed, 2017-02-15 at 11:12 +0900, Damien Le Moal wrote: >> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c >> index 1f5d92a..d05a328 100644 >> --- a/drivers/scsi/sd.c >> +++ b/drivers/scsi/sd.c >> @@ -1790,6 +17

Re: [PATCH v4] sd: Check for unaligned partial completion

2017-02-15 Thread Damien Le Moal
Bart, On 2/16/17 00:10, Bart Van Assche wrote: > On Wed, 2017-02-15 at 11:12 +0900, Damien Le Moal wrote: >> +resid = round_up(resid, sector_size); >> +if (resid < good_bytes) >> +good_bytes -= resid; >

Re: [PATCH v4] sd: Check for unaligned partial completion

2017-02-14 Thread Damien Le Moal
upport that was newly added to 4.10. So we need a fix for that and your issue combined before Linus releases 4.10 stable this weekend. Thanks. Best regards. -- Damien Le Moal, Ph.D. Sr. Manager, System Software Research Group, Western Digital Corporation damien.lem...@wdc.com (+81) 0466-98-359

[PATCH v4] sd: Check for unaligned partial completion

2017-02-14 Thread Damien Le Moal
e handling are ignored. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- Changes from v3: - Moved check to initial switch-case so that commands with special payload handling are ignored. Changes from v2: - Fixed good_bytes calculation after correction of unaligned resid It shou

[PATCH v3] sd: Check for unaligned partial completion

2017-02-14 Thread Damien Le Moal
he partial completion alignement check of mpt3sas to sd_done so that the check comes after good_bytes & resid corrections of done in that function depending on the request command to avoid false positive. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- Changes from v2

Re: [PATCH 1/1] mpt3sas: Ignore unaligned completion length for ZBC_IN

2017-02-13 Thread Damien Le Moal
Christoph, On 2/14/17 15:18, h...@lst.de wrote: > On Tue, Feb 14, 2017 at 02:21:37PM +0900, Damien Le Moal wrote: >>> I think we want to keep the knowledge of which requests have a request size >>> that should be a multiple of the logical block size in the block layer core &g

Re: [PATCH 1/1] mpt3sas: Ignore unaligned completion length for ZBC_IN

2017-02-13 Thread Damien Le Moal
Bart, On 2/14/17 14:11, Bart Van Assche wrote: > On Tue, 2017-02-14 at 13:42 +0900, Damien Le Moal wrote: >> I think so. But my understanding of REQ_TYPE_BLOCK_PC is that it is the >> type for requests issued internally (scsi_execute) of from things like >> the SG drive

Re: [PATCH 1/1] mpt3sas: Ignore unaligned completion length for ZBC_IN

2017-02-13 Thread Damien Le Moal
the type for requests issued internally (scsi_execute) of from things like the SG driver, so in essence, all requests not derived from a BIO... Is this correct ? If yes, then setting the BLOCK_TYPE_PC for REQ_OP_ZONE_REPORT (and REQ_OP_ZONE_RESET while at it) would break this model, wouldn't i

Re: [PATCH 1/1] mpt3sas: Ignore unaligned completion length for ZBC_IN

2017-02-13 Thread Damien Le Moal
Bart, On 2/14/17 03:57, Bart Van Assche wrote: > On Mon, 2017-02-13 at 14:11 +0900, Damien Le Moal wrote: >> The ZBC_IN command (REPORT ZONES) reply length is always a multiple of >> 64B and thus may not be aligned on the device LBA size. >> For this command, retry due to the

[PATCH 1/1] mpt3sas: Ignore unaligned completion length for ZBC_IN

2017-02-12 Thread Damien Le Moal
The ZBC_IN command (REPORT ZONES) reply length is always a multiple of 64B and thus may not be aligned on the device LBA size. For this command, retry due to the unaligned completion length is incorrect so do not check alignment of the reply length. Signed-off-by: Damien Le Moal <damien.

Re: RFC: 512e ZBC host-managed disks

2017-01-12 Thread Damien Le Moal
On 1/13/17 00:02, Jeff Moyer wrote: > Christoph Hellwig <h...@lst.de> writes: > >> On Thu, Jan 12, 2017 at 05:13:52PM +0900, Damien Le Moal wrote: >>> (3) Any other idea ? >> >> Do nothing and ignore the problem. This whole idea so braindead that >&g

RFC: 512e ZBC host-managed disks

2017-01-12 Thread Damien Le Moal
Best regards. -- Damien Le Moal, Ph.D. Sr. Manager, System Software Research Group, Western Digital Corporation damien.lem...@wdc.com (+81) 0466-98-3593 (ext. 513593) 1 kirihara-cho, Fujisawa, Kanagawa, 252-0888 Japan www.wdc.com, www.hgst.com -- To unsubscribe from this list: send the line "

[PATCH 2/2] sd: Ignore zoned field for host-managed devices

2017-01-11 Thread Damien Le Moal
There is no good match of the zoned filed of the block device characteristics page for host-managed devices. For these devices, the zoning model is derived directly from the device type. So ignore the zoned field for these drives. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- d

[PATCH 1/2] sd: Fix wrong DPOFUA disable in sd_read_cache_type

2017-01-11 Thread Damien Le Moal
trenghten the test by also checking that sdkp->use_16_for_rw is false. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index b193304..d7aaacf 100644 --- a

[PATCH 0/2] sd fixes for zoned block devices

2017-01-11 Thread Damien Le Moal
by the standard. Damien Le Moal (2): sd: Fix wrong DPOFUA disable in sd_read_cache_type sd: Ignore zoned field for host-managed devices drivers/scsi/sd.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubs

[PATCH] dm-zoned: Zoned block device target

2016-11-29 Thread Damien Le Moal
support for zoned block devices, on which dm-zoned depends). Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- Documentation/device-mapper/dm-zoned.txt | 157 +++ MAINTAINERS |7 + drivers/md/Kconfig | 16 + drivers/md/Ma

[PATCH] sd_zbc: Force use of READ16/WRITE16

2016-11-10 Thread Damien Le Moal
set. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd_zbc.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index 394ab49..92620c8 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -612,6 +612,

Re: [PATCH] sd: fix uninitialized variable access in error handling

2016-10-23 Thread Damien Le Moal
+ zone_blocks = 0; > goto out; > + } > > same = buf[4] & 0x0f; > if (same > 0) { Reviewed-by: Damien Le Moal <damien.lem...@wdc.com> -- Damien Le Moal, Ph.D. Sr. Manager, System Software Research Group, Western Digital C

<    1   2   3   4   >