From owner-freebsd-scsi@FreeBSD.ORG Sat Sep 20 17:17:09 2003 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DAC4216A4B3 for ; Sat, 20 Sep 2003 17:17:09 -0700 (PDT) Received: from smtp.mho.com (smtp.mho.net [64.58.4.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 4A48543FE1 for ; Sat, 20 Sep 2003 17:17:07 -0700 (PDT) (envelope-from scottl@freebsd.org) Received: (qmail 65542 invoked by uid 1002); 21 Sep 2003 00:17:06 -0000 Received: from unknown (HELO freebsd.org) (64.58.1.252) by smtp.mho.net with SMTP; 21 Sep 2003 00:17:06 -0000 Message-ID: <3F6CEDF8.5070803@freebsd.org> Date: Sat, 20 Sep 2003 18:16:56 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Thomas Quinot References: <20030920110131.GA41062@melusine.cuivre.fr.eu.org> In-Reply-To: <20030920110131.GA41062@melusine.cuivre.fr.eu.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-scsi@FreeBSD.org cc: gibbs@FreeBSD.org cc: ken@FreeBSD.org Subject: Re: Missing length specification in scsi_request_sense X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2003 00:17:10 -0000 Thomas Quinot wrote: > The CDB built by scsi_request_sense always has a zero length indication, > preventing correct transfer of sense data during recovery action by > cam_periph. The following change resolves the problem, please review. > > Thomas. > > Index: scsi/scsi_all.c > =================================================================== > RCS file: /home/ncvs/src/sys/cam/scsi/scsi_all.c,v > retrieving revision 1.42 > diff -u -r1.42 scsi_all.c > --- scsi/scsi_all.c 10 Jun 2003 18:14:04 -0000 1.42 > +++ scsi/scsi_all.c 20 Sep 2003 10:53:38 -0000 > @@ -2408,6 +2408,7 @@ > scsi_cmd = (struct scsi_request_sense *)&csio->cdb_io.cdb_bytes; > bzero(scsi_cmd, sizeof(*scsi_cmd)); > scsi_cmd->opcode = REQUEST_SENSE; > + scsi_cmd->length = dxfer_len; > } > > void > Since just about every driver in existance does auto-sense, it doesn't surprise me that you're finding these bugs. This patch looks reasonable to me. Scott