* [PATCH] scsi_debug: fix failure to probe with scsi_level=1 or 2 due to NULL devip
@ 2015-08-25 19:47 Ewan D. Milne
2015-08-27 14:14 ` Douglas Gilbert
0 siblings, 1 reply; 2+ messages in thread
From: Ewan D. Milne @ 2015-08-25 19:47 UTC (permalink / raw)
To: linux-scsi, dgilbert
From: "Ewan D. Milne" <emilne@redhat.com>
commit cbf67842c3d9 ("scsi_debug: support scsi-mq, queues and locks")
added a test for devip == NULL in schedule_resp which returned
SCSI_MLQUEUE_HOST_BUSY. Unfortunately, if scsi_level 1 or 2 is specified,
devip will be NULL for the INQUIRY command for the next LUN above the
configured value and it will be retried indefinitely with an error message.
Fix this by returning the command in the same context if no devip exists.
Signed-off-by: Ewan D. Milne <emilne@redhat.com>
---
drivers/scsi/scsi_debug.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 30268bb..25f5cee1 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3944,8 +3944,11 @@ schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip,
struct sdebug_queued_cmd *sqcp = NULL;
struct scsi_device *sdp = cmnd->device;
- if (NULL == cmnd || NULL == devip) {
- pr_warn("%s: called with NULL cmnd or devip pointer\n",
+ /* devip will be NULL when probing nonexistent LUNs w/o REPORT LUNS */
+ if (NULL == devip)
+ goto respond_in_thread;
+ if (NULL == cmnd) {
+ pr_warn("%s: called with NULL cmnd pointer\n",
__func__);
/* no particularly good error to report back */
return SCSI_MLQUEUE_HOST_BUSY;
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi_debug: fix failure to probe with scsi_level=1 or 2 due to NULL devip
2015-08-25 19:47 [PATCH] scsi_debug: fix failure to probe with scsi_level=1 or 2 due to NULL devip Ewan D. Milne
@ 2015-08-27 14:14 ` Douglas Gilbert
0 siblings, 0 replies; 2+ messages in thread
From: Douglas Gilbert @ 2015-08-27 14:14 UTC (permalink / raw)
To: Ewan D. Milne, linux-scsi
On 15-08-25 03:47 PM, Ewan D. Milne wrote:
> From: "Ewan D. Milne" <emilne@redhat.com>
>
> commit cbf67842c3d9 ("scsi_debug: support scsi-mq, queues and locks")
> added a test for devip == NULL in schedule_resp which returned
> SCSI_MLQUEUE_HOST_BUSY. Unfortunately, if scsi_level 1 or 2 is specified,
> devip will be NULL for the INQUIRY command for the next LUN above the
> configured value and it will be retried indefinitely with an error message.
> Fix this by returning the command in the same context if no devip exists.
>
> Signed-off-by: Ewan D. Milne <emilne@redhat.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-27 14:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-25 19:47 [PATCH] scsi_debug: fix failure to probe with scsi_level=1 or 2 due to NULL devip Ewan D. Milne
2015-08-27 14:14 ` Douglas Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).