All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: return TARGET_ERROR when a device has been disconnected
@ 2012-08-16  6:40 Hannes Reinecke
  2012-08-16 14:53 ` Michael Christie
  0 siblings, 1 reply; 3+ messages in thread
From: Hannes Reinecke @ 2012-08-16  6:40 UTC (permalink / raw)
  To: linux-scsi; +Cc: Hannes Reinecke, James Bottomley

When we receive a sense code of
NOT READY, LOGICAL UNIT NOT SUPPORTED
the device has been disconnected and any retry on other paths
would be pointless. So return TARGET_ERROR here.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: James Bottomley <jbottomley@parallels.com>
---
 drivers/scsi/scsi_error.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index de2337f..0fe639e 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -296,6 +296,10 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
 
 		return NEEDS_RETRY;
 	case NOT_READY:
+		if ((sshdr.asc == 0x25) && (sshdr.ascq == 0)) {
+			/* Logical unit not supported */
+			return TARGET_ERROR;
+		}
 	case UNIT_ATTENTION:
 		/*
 		 * if we are expecting a cc/ua because of a bus reset that we
-- 
1.7.4.2


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

end of thread, other threads:[~2012-08-16 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-16  6:40 [PATCH] scsi: return TARGET_ERROR when a device has been disconnected Hannes Reinecke
2012-08-16 14:53 ` Michael Christie
2012-08-16 14:59   ` Hannes Reinecke

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.