[stgt] [PATCH] sbc: update READ_CAPACITY_16 length
FUJITA Tomonori
fujita.tomonori at lab.ntt.co.jp
Thu Jul 15 09:17:11 CEST 2010
12 came from too old spec, I guess.
Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
---
usr/sbc.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/usr/sbc.c b/usr/sbc.c
index a048d53..b8e6887 100644
--- a/usr/sbc.c
+++ b/usr/sbc.c
@@ -161,15 +161,16 @@ static int sbc_service_action(int host_no, struct scsi_cmd *cmd)
{
uint32_t *data;
uint64_t size;
+ int len = 16;
if (cmd->scb[1] != SAI_READ_CAPACITY_16)
goto sense;
- if (scsi_get_in_length(cmd) < 12)
+ if (scsi_get_in_length(cmd) < len)
goto overflow;
data = scsi_get_in_buffer(cmd);
- memset(data, 0, 12);
+ memset(data, 0, len);
size = cmd->dev->size >> BLK_SHIFT;
@@ -177,7 +178,7 @@ static int sbc_service_action(int host_no, struct scsi_cmd *cmd)
data[2] = __cpu_to_be32(1UL << BLK_SHIFT);
overflow:
- scsi_set_in_resid_by_actual(cmd, 12);
+ scsi_set_in_resid_by_actual(cmd, len);
return SAM_STAT_GOOD;
sense:
sense_data_build(cmd, ILLEGAL_REQUEST, ASC_INVALID_OP_CODE);
--
1.6.5
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the stgt
mailing list