Data Out residual overflow/underflow handling
Paul Hughes <phughes <at> solidfire.com>
2012-09-21 03:21:32 GMT
Not sure if this is the best place to ask, but here goes...
How should an iSCSI target (SCSI direct-access block device) handle the following scenario:
An initiator issues an iSCSI Command Request PDU containing a SCSI Write CDB with a transfer length of 1 block. The iSCSI Command Request PDU has an Expected Data Transfer Length of 512 bytes, a Data Segment Length of 512 bytes (immediate data), and the Final flag is set. This would be a perfectly normal single block write, except that the target's logical unit is formatted with 4096-byte block size. So it appears the initiator is confused and sending a single 512-byte block write to a logical unit that is formatted to 4KB block size.
Here are my thoughts:
1) The target could write the 512 bytes of immediate data plus 3584 bytes (4096 minus 512) of whatever it wants to the media, and then send an iSCSI Command Response PDU with SCSI status of Good and reporting an Overflow with a residual count of 3584. This seems to be the most correct way of handling this scenario, but it seems dangerous to allow an apparently confused initiator to essentially corrupt data on the logical unit.
2) The target could send an iSCSI Command Response PDU with SCSI status of Check Condition, with sense data of Aborted Command, Invalid Field in Command Information Unit (0x0E03). This sense code is apparently intended for FCP (I found it mentioned in FCP-4) but it seems appropriate in this case. Assuming the target can fail the SCSI Write command this way (or some other way), should the target also report an Underflow with a residual count of 512?
Are there any other alternatives?
Ips mailing list
Ips <at> ietf.org