From owner-freebsd-scsi@FreeBSD.ORG Sun Jun 20 20:43:25 2004 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 61B0516A4CE for ; Sun, 20 Jun 2004 20:43:25 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFEB443D31 for ; Sun, 20 Jun 2004 20:43:24 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from freebsd.org (junior-wifi.samsco.home [192.168.0.11]) (authenticated bits=0) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id i5KKkSXF031219; Sun, 20 Jun 2004 14:46:28 -0600 (MDT) (envelope-from scottl@freebsd.org) Message-ID: <40D5F6B8.8060901@freebsd.org> Date: Sun, 20 Jun 2004 14:42:32 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040304 X-Accept-Language: en-us, en MIME-Version: 1.0 To: fox@vader.aacc.edu References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org cc: freebsd-scsi@freebsd.org Subject: Re: -stable vs -current handling of SSD_KEY_MISCOMPARE SCSI sense data 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, 20 Jun 2004 20:43:25 -0000 fox@vader.aacc.edu wrote: > While trying to diagnose an unrelated hardware problem, I stumbled on > the following code in RELENG_4 sys/cam/scsi/scsi_all.c (1.14.2.11): > > scsi_interpret_sense(...) > { > ... > switch (error_code) { > ... > case SSD_CURRENT_ERROR: > { > switch (sense_key) { > ... > case SSD_KEY_MISCOMPARE: > /* decrement the number of retries */ > retry = ccb->ccb_h.retry_count > 0; > if (retry) { > error = ERESTART; > ccb->ccb_h.retry_count--; > } else { > error = EIO; > } > case SSD_KEY_RECOVERED_ERROR: > error = 0; /* not an error */ > break; > > The lack of a break before "case SSD_KEY_RECOVERED_ERROR:" means that > all assignments to error in case "SSD_KEY_MISCOMPARE:" are expensive > comments, so I doubt that a /* FALLTHROUGH */ was intended. Also, this > code was added as part of 1.18, then MFC'd in 1.14.2.3, so it was most > likely deliberate. > > However, -current seems to ignore this error. sys/cam/scsi/scsi_all.c 1.44 > has: > > const struct sense_key_table_entry sense_key_table[] = > { > ... > { SSD_KEY_MISCOMPARE, SS_NOP, "MISCOMPARE" }, > > If I read the code in sys/cam/cam_periph.c correctly, this matches what > -stable does, but should have s/SS_NOP/SS_RDEF/ to match what I suspect > -stable was meant to do. > > OTOH, if -stable is really meant to do nothing in that case, perhaps it > could do so in a more straightforward way, or have a comment added. > > OTGH, I may be missing something obvious. > > Perusal of cvs-all and freebsd-scsi archives from around the time > scsi_all.c 1.21 was commited failed to elicit obvious clues. > > I eagerly await clue imparting, sarcasm, flamage, or LARTing. > Thanks for bringing this up. I'll review it today or tomorrow and commit whatever is appropriate. Scott