[PATCH] scsi: return TARGET_ERROR when a device has been disconnected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
Cc: James Bottomley <jbottomley@xxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux