From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 17:02:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D16CBD18 for ; Wed, 6 Aug 2014 17:02:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6E2027E3 for ; Wed, 6 Aug 2014 17:02:19 +0000 (UTC) Received: from mav (uid 1131) (envelope-from mav@FreeBSD.org) id 506b by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 17:02:19 +0000 From: Alexander Motin Date: Wed, 6 Aug 2014 17:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269631 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e25f9b.506b.2fc5af04@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 17:02:19 -0000 Author: mav Date: Wed Aug 6 17:02:19 2014 New Revision: 269631 URL: http://svnweb.freebsd.org/changeset/base/269631 Log: 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 Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Aug 6 16:44:31 2014 (r269630) +++ head/sys/cam/ctl/ctl.c Wed Aug 6 17:02:19 2014 (r269631) @@ -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));