From owner-freebsd-bugs@FreeBSD.ORG Mon Feb 9 10:40:19 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A4B516A4CF for ; Mon, 9 Feb 2004 10:40:19 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 01C8043D31 for ; Mon, 9 Feb 2004 10:40:19 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i19IeIbv080332 for ; Mon, 9 Feb 2004 10:40:18 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i19IeI4e080331; Mon, 9 Feb 2004 10:40:18 -0800 (PST) (envelope-from gnats) Resent-Date: Mon, 9 Feb 2004 10:40:18 -0800 (PST) Resent-Message-Id: <200402091840.i19IeI4e080331@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, John Engelhart Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1307B16A4CE for ; Mon, 9 Feb 2004 10:39:30 -0800 (PST) Received: from new.zang.com (unknown [205.150.102.81]) by mx1.FreeBSD.org (Postfix) with ESMTP id E782B43D31 for ; Mon, 9 Feb 2004 10:39:29 -0800 (PST) (envelope-from johne@zang.com) Received: from localhost (localhost.zang.com [127.0.0.1]) by new.zang.com (Postfix) with ESMTP id 4F8C23914AC for ; Mon, 9 Feb 2004 13:39:29 -0500 (EST) Received: from new.zang.com ([127.0.0.1]) by localhost (new.zang.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 01824-09 for ; Mon, 9 Feb 2004 13:39:28 -0500 (EST) Received: by new.zang.com (Postfix, from userid 1001) id B5C423914A4; Mon, 9 Feb 2004 13:39:27 -0500 (EST) Message-Id: <20040209183927.B5C423914A4@new.zang.com> Date: Mon, 9 Feb 2004 13:39:27 -0500 (EST) From: John Engelhart To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/62597: asr /dev/rdpti# patch X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John Engelhart List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2004 18:40:19 -0000 >Number: 62597 >Category: kern >Synopsis: asr /dev/rdpti# patch >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Mon Feb 09 10:40:18 PST 2004 >Closed-Date: >Last-Modified: >Originator: John Engelhart >Release: FreeBSD 5.2-RELEASE-p2 i386 >Organization: >Environment: System: FreeBSD new.zang.com 5.2-RELEASE-p2 FreeBSD 5.2-RELEASE-p2 #1: Mon Feb 9 10:51:29 EST 2004 johne@new.zang.com:/usr/src/sys/i386/compile/new i386 >Description: The utilities for the Adaptec RAID cards that use the asr driver (ie, Adaptect 2100s, 3210S, 3410S, etc) open the device /dev/rdpti# to communicate with the HBA. The asr device driver creates a device /dev/rasr#. The utilities, such as raidtuil, fork a 'dpteng' process to do all the communications. In FreeBSD's prior to 5, dpteng would call mknod("/dev/rdpti#",154,0); if the rdpti device wasn't there. These mknod() calls are failing in FreeBSD 5 w/ "No such file or directory" error code. Not sure what changed in the devfs symantics, but I'm of the opinion that dpteng shouldn't be calling mknod like this anyways. One way to fix this is to create a symlink, ln -s /dev/rasr0 /dev/rdpti0. This patch creates that symlink automagically from within the asr driver. It uses make_dev_alias() to do so. Therefore the Adaptec supplied RAID utils will continue to work without having to manually ln -s the rdpti device. Prior to patch: [root@new] /dev# /usr/local/dpt/raidutil -L all Engine connect failed: COMPATILITY number osdIOrequest : File /dev/rdptr17 Could Not Be Opened [disregard the device it says it can't open, it actually walks 0-17 and has a few names for it: dpti, rdpti, rdptir, etc..] >How-To-Repeat: >Fix: --- asr.c~ Fri Sep 26 11:56:42 2003 +++ asr.c Mon Feb 9 10:48:54 2004 @@ -2782,6 +2782,7 @@ { Asr_softc_t * sc; struct scsi_inquiry_data * iq; + dev_t dev; ATTACH_SET(); if ((sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT | M_ZERO)) == @@ -3127,8 +3128,11 @@ /* * Generate the device node information */ - (void)make_dev(&asr_cdevsw, unit, UID_ROOT, GID_OPERATOR, 0640, + dev = make_dev(&asr_cdevsw, unit, UID_ROOT, GID_OPERATOR, 0640, "rasr%d", unit); + if(dev) { + (void)make_dev_alias(dev,"rdpti%d",unit); + } ATTACH_RETURN(0); } /* asr_attach */ >Release-Note: >Audit-Trail: >Unformatted: