From 056f9029122c0f28889826285044ec5322bf768d Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 26 Mar 2014 03:23:57 +0000 Subject: [PATCH] scst_vdisk: Fix READ CAPACITY(10) SBC-2 defines the LBA as a 32-bit field that starts at offset 2 and not as a 64-bit field. Reported-by: Mike Christie Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5388 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 111246e8b..de66cba58 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -3375,7 +3375,7 @@ static enum compl_status_e vdisk_exec_read_capacity(struct vdisk_cmd_params *p) nblocks = virt_dev->nblocks; if ((cmd->cdb[8] & 1) == 0) { - uint64_t lba = get_unaligned_be64(&cmd->cdb[2]); + uint32_t lba = get_unaligned_be32(&cmd->cdb[2]); if (lba != 0) { TRACE_DBG("PMI zero and LBA not zero (cmd %p)", cmd); scst_set_cmd_error(cmd,