All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] [SCSI] scsi_debug: Do not respond to certain commands with CHECK CONDITION when sense pending
@ 2013-02-15 17:52 Ewan D. Milne
  2013-02-15 19:37 ` Douglas Gilbert
  0 siblings, 1 reply; 2+ messages in thread
From: Ewan D. Milne @ 2013-02-15 17:52 UTC (permalink / raw)
  To: linux-scsi

From: "Ewan D. Milne" <emilne@redhat.com>

According to SPC, certain commands are not supposed to respond
with a CHECK CONDITION due to a pending UNIT ATTENTION.  This
was causing failures when re-scanning a scsi_debug target.  The
commands in this category are INQUIRY and REPORT LUNS.

Signed-off-by: Ewan D. Milne <emilne@redhat.com>
---
 drivers/scsi/scsi_debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 8a6bf31..48fd5a7 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -4060,7 +4060,8 @@ write:
 		errsts = check_condition_result;
 		break;
 	}
-	if (!errsts && devip->sense_pending) {
+	if (!errsts && devip->sense_pending && (*cmd != INQUIRY) &&
+	    (*cmd != REPORT_LUNS)) {
 		devip->sense_pending = 0;
 		errsts = check_condition_result;
 	}
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] [SCSI] scsi_debug: Do not respond to certain commands with CHECK CONDITION when sense pending
  2013-02-15 17:52 [PATCH v2] [SCSI] scsi_debug: Do not respond to certain commands with CHECK CONDITION when sense pending Ewan D. Milne
@ 2013-02-15 19:37 ` Douglas Gilbert
  0 siblings, 0 replies; 2+ messages in thread
From: Douglas Gilbert @ 2013-02-15 19:37 UTC (permalink / raw)
  To: Ewan D. Milne; +Cc: linux-scsi

On 13-02-15 12:52 PM, Ewan D. Milne wrote:
> From: "Ewan D. Milne" <emilne@redhat.com>
>
> According to SPC, certain commands are not supposed to respond
> with a CHECK CONDITION due to a pending UNIT ATTENTION.  This
> was causing failures when re-scanning a scsi_debug target.  The
> commands in this category are INQUIRY and REPORT LUNS.
>
> 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:[~2013-02-15 19:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-15 17:52 [PATCH v2] [SCSI] scsi_debug: Do not respond to certain commands with CHECK CONDITION when sense pending Ewan D. Milne
2013-02-15 19:37 ` Douglas Gilbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.