On Wed, Dec 21, 2011 at 2:19 PM, Nicholas A. Bellinger <nab@xxxxxxxxxxxxxxx> wrote: > So we know that SBC says zero-length READs is allowed, but AFAICT there > is no requirement for allowing any zero-length control CDBs, aside from > the CDBs already designated as SCF_SCSI_NON_DATA_CDB.. Actually I think that's wrong -- my draft of SPC4 says: 4.3.5.6 Allocation length ... An allocation length of zero specifies that no data shall be transferred. This condition shall not be considered as an error. and eg on a real SCSI disk I have: # sg_raw -v /dev/sdas 3 0 0 0 0 0 cdb to send: 03 00 00 00 00 00 SCSI Status: Good Sense Information: sense buffer empty But I don't think we can just silently succeed control CDBs with allocation length 0, eg REQUEST SENSE will allocation length 0 still needs to clear unit attention conditions. So we probably need to push the handling down into the emulation for each command. And also I think the code that fails INQUIRY with allocation length < 6 is wrong too -- eg if the initiator sense us an allocation length of 1, we should return good status and just send back the first byte of the inquiry data. But that's a secondary issue -- at least we don't crash in that case. - R. -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html