[PATCH] fix incorrect logical unit handling

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

 



Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
---
 usr/scsi.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/usr/scsi.c b/usr/scsi.c
index bf39328..cef231b 100644
--- a/usr/scsi.c
+++ b/usr/scsi.c
@@ -204,6 +204,19 @@ int scsi_cmd_perform(int host_no, struct scsi_cmd *cmd)
 		return SAM_STAT_CHECK_CONDITION;
 	}
 
+	if (cmd->dev->lun != cmd->dev_id) {
+		switch (op) {
+		case INQUIRY:
+			break;
+		case REQUEST_SENSE:
+			sense_data_build(cmd, ILLEGAL_REQUEST, ASC_LUN_NOT_SUPPORTED);
+			return SAM_STAT_GOOD;
+		default:
+			sense_data_build(cmd, ILLEGAL_REQUEST, ASC_LUN_NOT_SUPPORTED);
+			return SAM_STAT_CHECK_CONDITION;
+		}
+	}
+
 	/* check out Unit Attention condition */
 	switch (op) {
 	case INQUIRY:
-- 
1.5.6.5

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

[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux