Reduce reported additional INQUIRY data length.

sizeof(struct scsi_inquiry_data) of 256 bytes combined with off-by-one
error in the changed code gave total INQUIRY data length above 255 bytes,
that was maximal INQUIRY length in SPC-2.  While SPC-3 increased the
maximal length to 64K, at least sg3_utils are still confused by that.

MFC after:	1 week
This commit is contained in:
Alexander Motin 2014-08-06 17:02:19 +00:00
parent 47350fa594
commit b0529e0a2d

View File

@ -10462,7 +10462,9 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio)
*/
inq_ptr->response_format = SID_HiSup | 2;
inq_ptr->additional_length = sizeof(*inq_ptr) - 4;
inq_ptr->additional_length =
offsetof(struct scsi_inquiry_data, vendor_specific1) -
(offsetof(struct scsi_inquiry_data, additional_length) + 1);
CTL_DEBUG_PRINT(("additional_length = %d\n",
inq_ptr->additional_length));