sg3_utils icon indicating copy to clipboard operation
sg3_utils copied to clipboard

sg_read gives error for more than 64 blocks

Open yehiaafaroukk opened this issue 3 years ago • 1 comments

trying to use sg_read for more than 64 blocks to read but ioctl failed example: sg_read if=/dev/sg5 count=65 bs=4096 cdbsz=10

but is succeeds for less than 65 example: sg_read if=/dev/sg5 count=64 bs=4096 cdbsz=10

EVEN if I am trying this without the tool by forming the CDB and sending the ioctl scsi command it is failing although for more than 256 kb data length (64*4k)

yehiaafaroukk avatar Aug 29 '21 15:08 yehiaafaroukk

# sg_read if=/dev/sg5 count=65 bs=4096 cdbsz=10 -vvvv
Opened /dev/sg5 for SG_IO with flags=0x2
  SG_GET_RESERVED_SIZE yields: 32768
    READ cdb: [28 00 00 00 00 00 00 00 41 00]
      duration=0 ms
65+0 records in, SCSI READ commands issued: 1

The above shows sg_read count=65 works. In this case the low level driver (LLD) is the scsi_debug driver in Linux. That suggests that the 64 block (64x4096 byte) limit is in the LLD you are using.

doug-gilbert avatar Sep 12 '21 17:09 doug-gilbert