[PATCH] set periph.qualifier to 7Fh (LUN mismatch) before INQUIRY buffer copy to data-in

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

 



From: Alexander Nezhinsky <nezhinsky@xxxxxxxxx>

Signed-off-by: Alexander Nezhinsky <nezhinsky@xxxxxxxxx>
---
 usr/spc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/usr/spc.c b/usr/spc.c
index 25153d9..ef3501b 100644
--- a/usr/spc.c
+++ b/usr/spc.c
@@ -281,12 +281,12 @@ int spc_inquiry(int host_no, struct scsi_cmd *cmd)
 	if (ret != SAM_STAT_GOOD)
 		goto sense;
 
-	scsi_set_in_resid_by_actual(cmd, len);
-	memcpy(scsi_get_in_buffer(cmd), data, scb[4]);
-
 	if (cmd->dev->lun != cmd->dev_id)
 		data[0] = TYPE_NO_LUN;
 
+	scsi_set_in_resid_by_actual(cmd, len);
+	memcpy(scsi_get_in_buffer(cmd), data, scb[4]);
+
 	return SAM_STAT_GOOD;
 sense:
 	scsi_set_in_resid_by_actual(cmd, 0);
-- 
1.7.9.6

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