[PATCH 0/6] blk-mq: initialize pdu of flush req explicitly

2014-09-07 Thread Ming Lei
Hi, This patchset introduces init_flush_rq and its pair callback to initialize pdu of flush request explicitly, instead of using copying from request which is inefficient and buggy, and implements them in virtio-blk and scsi-lib. block/blk-flush.c | 22 +- block/bl

[PATCH 6/6] blk-mq: don't copy pdu any more for flush req

2014-09-07 Thread Ming Lei
The in-tree drivers which need to handle flush request have implemented init_flush_rq already, so don't copy pdu any more for flush req. Signed-off-by: Ming Lei --- block/blk-mq.c |7 --- 1 file changed, 7 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 113d58d..16f595f

[PATCH 1/6] blk-mq: allocate flush_rq in blk_mq_init_flush()

2014-09-07 Thread Ming Lei
It is reasonable to allocate flush req in blk_mq_init_flush(). Signed-off-by: Ming Lei --- block/blk-flush.c | 11 ++- block/blk-mq.c| 16 ++-- block/blk-mq.h|2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/block/blk-flush.c b/block/blk-

[PATCH 5/6] scsi-lib: implement init_flush_rq and its pair

2014-09-07 Thread Ming Lei
Now implement init_flush_rq callback to avoid the unnecessary pdu copying done in blk_mq_clone_flush_request(). The sense buffer is introduced to flush req, but it won't be a deal since there is only one flush request per queue. It still may be borrowed from the sence buffer of the request cloned

[PATCH 3/6] blk-mq: don't copy pdu if init_flush_rq is implemented

2014-09-07 Thread Ming Lei
Current copying serves purpose of initializing flush req's pdu, so don't do that if init_flush_rq is implemented. Signed-off-by: Ming Lei --- block/blk-mq.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 1daef32..113d58d 100644

[PATCH 4/6] virtio-blk: implement init_flush_rq

2014-09-07 Thread Ming Lei
Now we use init_flush_rq callback to initialize pdu of flush req. Signed-off-by: Ming Lei --- drivers/block/virtio_blk.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 0a58140..f478ec8 100644 ---

[PATCH 2/6] blk-mq: introduce init_flush_rq callback and its pair

2014-09-07 Thread Ming Lei
Currently pdu of the flush rq is simlpy copied from another rq, turns out it isn't a good approach: - it isn't enough to initialize pointer field well, and easy to cause bugs if some pointers filed are included in pdu - the copy isn't necessary, because the pdu sho

Re: WARNING in block layer triggered in 3.17-rc3

2014-09-07 Thread Ming Lei
On Sat, Sep 6, 2014 at 1:45 AM, Alan Stern wrote: > James and Jens: > > I got a WARNING when unbinding the sd driver from a USB flash drive and > then binding it back again. Here's where the flash drive gets probed > initially: > > [ 143.300886] usb-storage 4-8:1.0: usb_probe_interface > [ 143.

Re: [PATCH 1/4] libata: consolidate ata_dev_classify()

2014-09-07 Thread Hannes Reinecke
On 09/06/2014 02:52 PM, Tejun Heo wrote: Hello, On Sat, Sep 06, 2014 at 10:21:51AM +0200, Hannes Reinecke wrote: Well, yes, in principle. I was looking into that, too. But then I figured that moving to ata_taskfile would be a major overhaul for libsas, which would be quite beyond scope here. An

Re: [PATCH 1/1] libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu

2014-09-07 Thread Sagi Grimberg
On 9/3/2014 8:00 AM, micha...@cs.wisc.edu wrote: From: Mike Christie This patches fixes a potential buffer overrun in __iscsi_conn_send_pdu. This function is used by iscsi drivers and userspace to send iscsi PDUs/ commands. For login commands, we have a set buffer size. For all other commands w

Re: [PATCH 1/4] libata: consolidate ata_dev_classify()

2014-09-07 Thread Tejun Heo
On Sun, Sep 07, 2014 at 01:24:47PM +0200, Hannes Reinecke wrote: > Which was actually my first attempt, but then I figured I'd be > increasing the stacksize in doing so. > But sure, if you're okay with it I'll be redoing the patch. The struct is only 32 bytes. I don't think it's gonna make any me

Re: [PATCH 14/20] scsi: use local buffer for printing CDB

2014-09-07 Thread Christoph Hellwig
On Wed, Sep 03, 2014 at 12:06:09PM +0200, Hannes Reinecke wrote: > The CDB needs to be printed in one line (ie with one printk > statement) to avoid the individual bytes to be broken up > under high load. > As using individual printk() statements here would lead to > unnecessary complicated code an

Re: [PATCH 16/20] scsi: separate out scsi_retval_string()

2014-09-07 Thread Christoph Hellwig
On Wed, Sep 03, 2014 at 12:06:11PM +0200, Hannes Reinecke wrote: > Implement scsi_retval_string() to simplify logging. Needs a way better patch description. What exactly is this going to be useful for? -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a mess

Re: [PATCH 17/20] scsi: separate out scsi_host_hostbyte() and scsi_show_driverbyte()

2014-09-07 Thread Christoph Hellwig
This needs a patch description that tells us why this change is useful. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 18/20] scsi: remove scsi_show_result()

2014-09-07 Thread Christoph Hellwig
On Wed, Sep 03, 2014 at 12:06:13PM +0200, Hannes Reinecke wrote: > scsi_show_result() was only ever used in one place in sd.c. > So open-code scsi_show_result() in sd.c and remove it from > constants.c. This does a lot more refactoring in sd.c, which needs a proper explanation and probably splitti

Re: [PATCH 19/20] sd: Reduce logging output

2014-09-07 Thread Christoph Hellwig
On Wed, Sep 03, 2014 at 12:06:14PM +0200, Hannes Reinecke wrote: > There is no need to print out the command result verbatim; > that will be done by the scsi stack if required. > Here we just should log the result in short if requested. Looks good, Reviewed-by: Christoph Hellwig -- To unsubscrib

Re: [PATCH 0/7] Use 'Scsi_Host' as argument for host reset

2014-09-07 Thread Christoph Hellwig
Did you plan to get back to this series and revisit it per the comments? I'd love to at least get the first preparatory patches in ASAP. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vge

Re: [PATCH 1/2] scsi_scan: Send TEST UNIT READY to the LUN before scanning

2014-09-07 Thread Christoph Hellwig
Looks like you put a version into the SuSE tree with a blacklist entry just for the Fujitsu array that requires the TEST UNIT READY. Can you send that version upstream as well? -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kern

I/O path cleanup

2014-09-07 Thread Christoph Hellwig
This series cleans up a couple of lose ends I noticed during the scsi-mq work, but which weren't important enough to address during the last cycle. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at

[PATCH 1/8] scsi: don't use scsi_next_command in scsi_reset_provider

2014-09-07 Thread Christoph Hellwig
scsi_reset_provider already manually runs all queues for the given host, so it doesn't need the scsi_run_queues call from it, and it doesn't need a reference on the device because it's synchronous. So let's just call scsi_put_command directly and avoid the device reference dance to simplify the co

[PATCH 2/8] scsi: remove scsi_next_command

2014-09-07 Thread Christoph Hellwig
There's only one caller left, so inline it and reduce the blk-mq vs !blk-mq diff a litte bit. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi_lib.c | 18 -- drivers/scsi/scsi_priv.h | 1 - 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/scsi_

[PATCH 6/8] scsi: move more requeue handling into scsi_requeue_command

2014-09-07 Thread Christoph Hellwig
Move a bit code out of scsi_io_completion and into scsi_requeue_command in preparation for further refactoring. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi_lib.c | 85 ++--- 1 file changed, 38 insertions(+), 47 deletions(-) diff --git a/dri

[PATCH 4/8] scsi: stop passing a gfp_mask argument down the command setup path

2014-09-07 Thread Christoph Hellwig
There is no reason for ULDs to pass in a flag on how to allocate the S/G lists. While we don't need GFP_ATOMIC for the blk-mq case because we don't hold locks, that decision can be made way down the chain without having to pass a pointless gfp_mask argument. Signed-off-by: Christoph Hellwig ---

[PATCH 5/8] scsi: move scsi_dispatch_cmd to scsi_lib.c

2014-09-07 Thread Christoph Hellwig
scsi_lib.c is where the rest of the I/O submission path lives, so move scsi_dispatch_cmd there and mark it static. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi.c | 81 drivers/scsi/scsi_lib.c | 81 ++

[PATCH 3/8] scsi: clean up S/G table freeing

2014-09-07 Thread Christoph Hellwig
Now that we are using the split completion model for the legacy request path as well we can use scsi_mq_free_sgtables unconditionally. Rename it to scsi_free_sgtables, use it for the legacy path and remove scsi_release_(bidi_)buffers. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi_lib.c

[PATCH 7/8] scsi: split error handling slow path out of scsi_io_completion

2014-09-07 Thread Christoph Hellwig
Move the error handling path out of scsi_io_completion and into an out of line helper. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi_lib.c | 263 +--- 1 file changed, 136 insertions(+), 127 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/

[PATCH 8/8] scsi: merge scsi_finish_command and scsi_io_completion

2014-09-07 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- Documentation/scsi/scsi_eh.txt | 12 +++--- drivers/scsi/scsi.c| 58 - drivers/scsi/scsi_lib.c| 84 +++--- drivers/scsi/scsi_priv.h | 1 - 4 files changed, 59 insertions

Re: Block/SCSI data integrity update v3

2014-09-07 Thread Christoph Hellwig
On Thu, Aug 28, 2014 at 02:10:49PM -0600, Jens Axboe wrote: > On 08/28/2014 01:31 PM, Martin K. Petersen wrote: > > This is the data integrity patch series originally submitted for 3.16 > > and 3.17. It has been rebased on top of block/for-3.18/core. Other > > than that there are no changes from

3.16.2: 2TiB Seagate Expansion Desk apparently still broken with both USB mass storage *and* UAS: some debugging output

2014-09-07 Thread Nix
I have a brand new Seagate Expansion Desk drive attached to my x86-64 desktop. (I also have a 4TiB model of the same drive, but I haven't even unboxed it: there seems little point as long as the 2TiB version doesn't work.) I am seeing apparently the same problem as Alexandre Oliva reported in

Re: [PATCH 0/6] blk-mq: initialize pdu of flush req explicitly

2014-09-07 Thread Christoph Hellwig
This works fine for me, although I still don't really like it very much. If you really want to go down the path of major surgery in this area we should probably allocate a flush request per hw_ctx, and initialize it using the normal init/exit functions. If we want to have proper multiqueue perfor

Re: [PATCH 4/6] virtio-blk: implement init_flush_rq

2014-09-07 Thread Christoph Hellwig
A couple comments not directly related to this patch, it's just a convenient vehicle for my rants :) > @@ -556,6 +555,19 @@ static int virtblk_init_request(void *data, struct > request *rq, > struct virtio_blk *vblk = data; > struct virtblk_req *vbr = blk_mq_rq_to_pdu(rq); > > +

Re: [PATCH 5/6] scsi-lib: implement init_flush_rq and its pair

2014-09-07 Thread Christoph Hellwig
> +static int __scsi_init_request(struct request *rq, int numa_node) Nitpick: Please use a sane name here, e.g. scsi_mq_alloc/free_sense_buffer. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at h

Re: 3.16.2: 2TiB Seagate Expansion Desk apparently still broken with both USB mass storage *and* UAS: some debugging output

2014-09-07 Thread Alan Stern
On Sun, 7 Sep 2014, Nix wrote: > I have a brand new Seagate Expansion Desk drive attached to my x86-64 > desktop. (I also have a 4TiB model of the same drive, but I haven't even > unboxed it: there seems little point as long as the 2TiB version doesn't > work.) I am seeing apparently the same prob

Looks like a broken hub? (was Re: 3.16.2: 2TiB Seagate Expansion Desk apparently still broken with both USB mass storage *and* UAS: some debugging output)

2014-09-07 Thread Nix
On 7 Sep 2014, Alan Stern spake thusly: > On Sun, 7 Sep 2014, Nix wrote: > >> I have a brand new Seagate Expansion Desk drive attached to my x86-64 >> desktop. (I also have a 4TiB model of the same drive, but I haven't even >> unboxed it: there seems little point as long as the 2TiB version doesn'

RE: scsi-mq and 3.17rc1

2014-09-07 Thread Elliott, Robert (Server Storage)
> -Original Message- > From: Christoph Hellwig [mailto:h...@infradead.org] > Sent: Monday, 25 August, 2014 9:51 AM > To: Elliott, Robert (Server Storage) > Cc: linux-scsi@vger.kernel.org > Subject: Re: scsi-mq and 3.17rc1 > > On Mon, Aug 25, 2014 at 02:31:58PM +, Elliott, Robert (Ser

Re: WARNING in block layer triggered in 3.17-rc3

2014-09-07 Thread Shirish Pargaonkar
I think the problem is, when a gendisk is detached, its request queue is not put in bypass mode cause when it is re-attached, code tries to put it out of bypass mode, hence the warning. So either of these should work, I have not tested it, just coded it up. diff --git a/block/blk-sysfs.c b/block/

Re: [PATCH 0/7] Use 'Scsi_Host' as argument for host reset

2014-09-07 Thread Hannes Reinecke
On 09/07/2014 06:21 PM, Christoph Hellwig wrote: Did you plan to get back to this series and revisit it per the comments? I'd love to at least get the first preparatory patches in ASAP. Up to now I've been focussed on the printk series, and I've shelved this one as the initial feedback was to h