jSCSI icon indicating copy to clipboard operation
jSCSI copied to clipboard

Read Capacity reports total # of blocks, not address of last block

Open dsu-igeek opened this issue 13 years ago • 2 comments

I've been getting reads past the end of my device from the Linux iSCSI initiator and the size reported in the log when login to the device occurs is the number of blocks + 1. The ReadCapacityStage uses the AbstractStorageModule.getSizeInBlocks() as the returned LBA and I think it should be using getSizeInBlocks() - 1, the address of the last addressable block.

This man page explains the behavior, http://manpages.ubuntu.com/manpages/dapper/man8/sg_readcap.8.html.

If you agree, I'll submit a fix for this. It may require some changes on the initiator side as well but I'm not using that at the moment so I haven't dug too deeply into it.

dsu-igeek avatar Apr 26 '12 15:04 dsu-igeek

Makes sense, yes.

Could you provide a fix…I am going to let it tested against the initiator and will merge in if the test stays successful.

sebastiangraf avatar Apr 26 '12 21:04 sebastiangraf

Hi, I think my problem is related to ReadCapacity16. I could open 8TB in Widows but when I try to open 16 TB if fails and the wireShark shows [Malformed Packet: SCSI]. Could you help me to solve this? I am using MS iscsi initiator.on win8. The MS iscsi initiator sends this message: SCSI CDB Service Action In(16)

The iscsi target respnse is: SCSI Payload (Service Action In(16) Response Data) LBA: 34359738368 (16384 GB) Block size in bytes: 512 [Malformed Packet: SCSI]

This is the log of wireShark http://ustore1.rnp.br/ustore/faces/publicFile.xhtml?code=18d9c3271e0606816fd2183e924ffd8b

thanks in advance

felipegutierrez avatar Nov 18 '14 16:11 felipegutierrez