From: "Ewan D. Milne" <emi...@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.  However, devip will be NULL for any SCSI command
to a LUN above the configured value, and if scsi_level=1 or 2 is specified,
we will attempt to probe such unconfigured LUNs.  An INQUIRY command to an
unconfigured LUN will then 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 <emi...@redhat.com>
---
 drivers/scsi/scsi_debug.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index dfcc45b..a26b533 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3946,11 +3946,9 @@ schedule_resp(struct scsi_cmnd *cmnd, struct 
sdebug_dev_info *devip,
        if (WARN_ON(!cmnd))
                return SCSI_MLQUEUE_HOST_BUSY;
 
-       if (NULL == devip) {
-               pr_warn("called devip == NULL\n");
-               /* no particularly good error to report back */
-               return SCSI_MLQUEUE_HOST_BUSY;
-       }
+       /* devip will be NULL when probing nonexistent LUNs w/o REPORT LUNS */
+       if (NULL == devip)
+               goto respond_in_thread;
 
        sdp = cmnd->device;
 
-- 
2.1.0

--
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

Reply via email to