From owner-freebsd-bugs@FreeBSD.ORG Sun Feb 25 09:50:06 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1196316A401 for ; Sun, 25 Feb 2007 09:50:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id E094213C478 for ; Sun, 25 Feb 2007 09:50:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l1P9o5nW071964 for ; Sun, 25 Feb 2007 09:50:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l1P9o5BK071963; Sun, 25 Feb 2007 09:50:05 GMT (envelope-from gnats) Resent-Date: Sun, 25 Feb 2007 09:50:05 GMT Resent-Message-Id: <200702250950.l1P9o5BK071963@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Joost Bekkers Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 782C316A400 for ; Sun, 25 Feb 2007 09:42:41 +0000 (UTC) (envelope-from joost@jodocus.org) Received: from amsfep19-int.chello.nl (amsfep19-int.chello.nl [62.179.120.14]) by mx1.freebsd.org (Postfix) with ESMTP id BA9F613C471 for ; Sun, 25 Feb 2007 09:42:40 +0000 (UTC) (envelope-from joost@jodocus.org) Received: from bps.jodocus.org ([89.98.160.245]) by amsfep20-int.chello.nl (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with ESMTP id <20070225082926.FQRO15683.amsfep20-int.chello.nl@bps.jodocus.org> for ; Sun, 25 Feb 2007 09:29:26 +0100 Received: from jodocus.org (localhost [127.0.0.1]) by bps.jodocus.org (8.13.8/8.13.8) with ESMTP id l1P8TORE085628 for ; Sun, 25 Feb 2007 09:29:24 +0100 (CET) (envelope-from joost@jodocus.org) Received: (from joost@localhost) by jodocus.org (8.13.8/8.13.8/Submit) id l1P8TOgt085627; Sun, 25 Feb 2007 09:29:24 +0100 (CET) (envelope-from joost) Message-Id: <200702250829.l1P8TOgt085627@jodocus.org> Date: Sun, 25 Feb 2007 09:29:24 +0100 (CET) From: Joost Bekkers To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/109521: [patch] 'chio return' breaks on non-voltag changers X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Joost Bekkers List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2007 09:50:06 -0000 >Number: 109521 >Category: bin >Synopsis: [patch] 'chio return' breaks on non-voltag changers >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Feb 25 09:50:05 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Joost Bekkers >Release: FreeBSD 6.2-RELEASE amd64 >Organization: >Environment: System: FreeBSD bps.jodocus.org 6.2-RELEASE FreeBSD 6.2-RELEASE #1: Sun Jan 21 12:43:37 CET 2007 root@:/usr/obj/usr/src/sys/bps amd64 >Description: Trying the `chio return` command on a changer without volume tags results in a cry from the kernel: (ch0:ahc0:0:4:1): READ ELEMENT STATUS. CDB: b8 30 0 1 0 1 0 0 4 0 0 0 (ch0:ahc0:0:4:1): CAM Status: SCSI Status Error (ch0:ahc0:0:4:1): SCSI Status: Check Condition (ch0:ahc0:0:4:1): ILLEGAL REQUEST asc:24,0 (ch0:ahc0:0:4:1): Invalid field in CDB: Command byte 1 bit 4 is invalid (ch0:ahc0:0:4:1): Unretryable error byte 1 bit 4 == volume tags This call originates from get_element_status() which is only called from inside do_return(). The volume tag information appears to never be used, so why ask for it? >How-To-Repeat: On a changer without voltag support do: chio move slot 0 drive 0 chio return drive 0 I haven't been able to test this with any other model than the one I have. # camcontrol devlist (HP C1557A U709) at scbus0 target 4 lun 0 (sa0,pass0) (HP C1557A U709) at scbus0 target 4 lun 1 (ch0,pass1) >Fix: --- src/bin/chio/chio.c_6.2R Sun Feb 25 09:15:39 2007 +++ src/bin/chio/chio.c Sun Feb 25 09:14:06 2007 @@ -1020,7 +1020,12 @@ cesr.cesr_element_type = (uint16_t)type; cesr.cesr_element_base = (uint16_t)element; cesr.cesr_element_count = 1; /* Only this one element */ - cesr.cesr_flags |= CESR_VOLTAGS; /* Grab voltags as well */ + /* 25/02/2007 Joost Bekkers: + * Don't ask for voltags. The information is currently never used + * and it breaks the return command for changers that don't support + * voltags. + */ + //cesr.cesr_flags |= CESR_VOLTAGS; /* Grab voltags as well */ cesr.cesr_element_status = ces; if (ioctl(changer_fd, CHIOGSTATUS, (char *)&cesr) == -1) { >Release-Note: >Audit-Trail: >Unformatted: