From owner-freebsd-bugs Tue Sep 30 09:00:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id JAA03508 for bugs-outgoing; Tue, 30 Sep 1997 09:00:05 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id JAA03499; Tue, 30 Sep 1997 09:00:01 -0700 (PDT) Resent-Date: Tue, 30 Sep 1997 09:00:01 -0700 (PDT) Resent-Message-Id: <199709301600.JAA03499@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, Andre Albsmeier Received: from david-relay.siemens.de (david-relay.siemens.de [139.23.36.13]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id IAA03377 for ; Tue, 30 Sep 1997 08:58:08 -0700 (PDT) Received: from salomon.mchp.siemens.de (salomon.siemens.de [139.23.33.13]) by david-relay.siemens.de (8.8.7/8.8.7) with ESMTP id RAA27094 for ; Tue, 30 Sep 1997 17:55:07 +0200 (MET DST) Received: from curry.mchp.siemens.de (daemon@curry.mchp.siemens.de [146.180.31.23]) by salomon.mchp.siemens.de (8.8.7/8.8.5) with ESMTP id RAA16557 for ; Tue, 30 Sep 1997 17:58:03 +0200 (MDT) Received: (from daemon@localhost) by curry.mchp.siemens.de (8.8.7/8.8.7) id RAA02366 for ; Tue, 30 Sep 1997 17:58:03 +0200 (MET DST) Message-Id: <199709301557.RAA03366@curry.mchp.siemens.de> Date: Tue, 30 Sep 1997 17:57:58 +0200 (CEST) From: Andre Albsmeier To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: kern/4660: bug in wd.c when using devfs Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4660 >Category: kern >Synopsis: bug in wd.c when using devfs >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 30 09:00:00 PDT 1997 >Last-Modified: >Originator: Andre Albsmeier >Organization: >Release: FreeBSD 2.2-STABLE i386 >Environment: I suspect all systems, but at least 2.2-STABLE >Description: When using devfs on 2.2-STABLE with 3 IDE drives, I saw that wd2 doesn't appear in /devs. Instead, when booting, the kernel prints a message that wd0 (yes, wd0) is already present. IMHO this is due to a bug in wd.c: When calling the devfs routines, the variable unit is passed instead of lunit. As far as I am correct, unit refers to the physical unit on the controller wdc which is 0 for wd2. And lunit refers to the logical unit which is 2 for wd2. So the kernel thinks, wd0 should be registered once more and complains. I have attached my changes to wd.c which makes it work. Maybe, this applies to 2.1 and current, too. And maybe, I am also completely wrong :-) *** wd.c.ORI Sun Sep 21 14:38:19 1997 --- wd.c Sun Sep 21 14:50:16 1997 *************** *** 478,492 **** wdtimeout(du); #ifdef DEVFS ! mynor = dkmakeminor(unit, WHOLE_DISK_SLICE, RAW_PART); du->dk_bdev = devfs_add_devswf(&wd_bdevsw, mynor, DV_BLK, UID_ROOT, GID_OPERATOR, 0640, ! "wd%d", unit); du->dk_cdev = devfs_add_devswf(&wd_cdevsw, mynor, DV_CHR, UID_ROOT, GID_OPERATOR, 0640, ! "rwd%d", unit); #endif if (dk_ndrive < DK_NDRIVE) { --- 478,492 ---- wdtimeout(du); #ifdef DEVFS ! mynor = dkmakeminor(lunit, WHOLE_DISK_SLICE, RAW_PART); du->dk_bdev = devfs_add_devswf(&wd_bdevsw, mynor, DV_BLK, UID_ROOT, GID_OPERATOR, 0640, ! "wd%d", lunit); du->dk_cdev = devfs_add_devswf(&wd_cdevsw, mynor, DV_CHR, UID_ROOT, GID_OPERATOR, 0640, ! "rwd%d", lunit); #endif if (dk_ndrive < DK_NDRIVE) { >How-To-Repeat: Make a machine with at least 3 IDE drives and enable devfs. >Fix: see above >Audit-Trail: >Unformatted: