From owner-freebsd-stable Sun Sep 21 07:44:54 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id HAA02915 for stable-outgoing; Sun, 21 Sep 1997 07:44:54 -0700 (PDT) Received: from david.siemens.de (david.siemens.de [139.23.36.11]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id HAA02909 for ; Sun, 21 Sep 1997 07:44:51 -0700 (PDT) Received: from salomon.mchp.siemens.de (salomon.siemens.de [139.23.33.13]) by david.siemens.de (8.8.7/8.8.5) with ESMTP id QAA00391 for ; Sun, 21 Sep 1997 16:44:38 +0200 (MDT) 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 QAA22026 for ; Sun, 21 Sep 1997 16:44:49 +0200 (MDT) Received: (from daemon@localhost) by curry.mchp.siemens.de (8.8.7/8.8.7) id QAA14700 for ; Sun, 21 Sep 1997 16:44:48 +0200 (MET DST) From: Andre Albsmeier Message-Id: <199709211444.QAA28591@curry.mchp.siemens.de> Subject: Bug in wd.c when using devfs To: freebsd-stable@freebsd.org Date: Sun, 21 Sep 1997 16:44:40 +0200 (CEST) X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi, 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. Please tell me if this is correct, and I send in a PR. Maybe, this applies to 2.1 and current, too. Thanks, -Andre *** 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) {