mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-20 14:16:31 +00:00
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 <michaelc@cs.wisc.edu> Signed-off-by: Bart Van Assche <bvanassche@acm.org> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5388 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user