Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sg_read gives error for more than 64 blocks #72

Open
yehiaafaroukk opened this issue Aug 29, 2021 · 1 comment
Open

sg_read gives error for more than 64 blocks #72

yehiaafaroukk opened this issue Aug 29, 2021 · 1 comment

Comments

@yehiaafaroukk
Copy link

yehiaafaroukk commented Aug 29, 2021

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)

@doug-gilbert
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants