From owner-svn-src-head@FreeBSD.ORG Fri Feb 5 12:40:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BD9E106566B; Fri, 5 Feb 2010 12:40:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BF328FC20; Fri, 5 Feb 2010 12:40:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o15CeIQq039918; Fri, 5 Feb 2010 12:40:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o15CeIbO039916; Fri, 5 Feb 2010 12:40:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002051240.o15CeIbO039916@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Feb 2010 12:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203524 - head/sys/dev/ciss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 05 Feb 2010 12:40:18 -0000 Author: mav Date: Fri Feb 5 12:40:18 2010 New Revision: 203524 URL: http://svn.freebsd.org/changeset/base/203524 Log: When hacking INQUIRY result, make sure that it is right INQUIRY and there is enough of result to hack. Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Fri Feb 5 12:17:14 2010 (r203523) +++ head/sys/dev/ciss/ciss.c Fri Feb 5 12:40:18 2010 (r203524) @@ -3286,10 +3286,15 @@ ciss_cam_complete_fixup(struct ciss_soft { struct scsi_inquiry_data *inq; struct ciss_ldrive *cl; + uint8_t *cdb; int bus, target; - if (((csio->ccb_h.flags & CAM_CDB_POINTER) ? - *(u_int8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes[0]) == INQUIRY) { + cdb = (csio->ccb_h.flags & CAM_CDB_POINTER) ? + (uint8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes; + if (cdb[0] == INQUIRY && + (cdb[1] & SI_EVPD) == 0 && + (csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN && + csio->dxfer_len >= SHORT_INQUIRY_LENGTH) { inq = (struct scsi_inquiry_data *)csio->data_ptr; target = csio->ccb_h.target_id;