Date: Sun, 17 Aug 2014 18:26:35 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270109 - stable/10/sys/cam/ctl Message-ID: <201408171826.s7HIQZfJ050049@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Sun Aug 17 18:26:34 2014 New Revision: 270109 URL: http://svnweb.freebsd.org/changeset/base/270109 Log: MFC r269631: 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. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Aug 17 18:24:59 2014 (r270108) +++ stable/10/sys/cam/ctl/ctl.c Sun Aug 17 18:26:34 2014 (r270109) @@ -10464,7 +10464,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));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408171826.s7HIQZfJ050049>