From owner-freebsd-bugs Thu Oct 22 19:40:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA10364 for freebsd-bugs-outgoing; Thu, 22 Oct 1998 19:40:07 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA10357 for ; Thu, 22 Oct 1998 19:40:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id TAA13859; Thu, 22 Oct 1998 19:40:01 -0700 (PDT) Received: from nhj.nlc.net.au (nhj.nlc.net.au [203.24.133.1]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id TAA10226 for ; Thu, 22 Oct 1998 19:38:46 -0700 (PDT) (envelope-from root@nlc.net.au) Received: (qmail 18307 invoked from network); 23 Oct 1998 12:38:18 +1000 Received: from monster.nlc.net.au (203.24.133.4) by nhj.nlc.net.au with SMTP; 23 Oct 1998 12:38:18 +1000 Received: (qmail 19721 invoked by uid 0); 23 Oct 1998 12:38:14 +1000 Message-Id: <19981023023814.19720.qmail@monster.nlc.net.au> Date: 23 Oct 1998 12:38:14 +1000 From: john@nlc.net.au Reply-To: john@nlc.net.au To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: i386/8418: sh MAKEDEV all - fails to create hard links properly Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 8418 >Category: i386 >Synopsis: sh MAKEDEV all - fails to create hard links properly >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Oct 22 19:40:00 PDT 1998 >Last-Modified: >Originator: John Saunders >Organization: NORTHLINK COMMUNICATIONS >Release: FreeBSD 2.2.7-STABLE i386 >Environment: FreeBSD 2.2.7-STABLE cvsupped October 12th. Problem appeared in the process of finalizing a make world by re-running sh MAKEDEV all in /dev. >Description: For the following MAKEDEV targets; fd, ft and st; MAKEDEV tries to make a hard link for several names to the one device node. However because an old version of the name exists, and the -f option isn't supplied, the link fails. This leaves the alternative names linked to an old device node. In the case that the major or minor device number changes for these devices, this will cause incorrect system operation. >How-To-Repeat: In the /dev directory run "sh MAKEDEV fd0", then "ls -l fd0*". The device nodes fd0, fd0a, fd0b, ... fd0h should be all linked to the same device node (2,0). There should be a link count of 9. However with the bug fd0 gets re-created and fd0a ... fd0h are orphaned because the hard link fails. (link count is 8 on fd0a ... fd0h, and 1 on fd0). >Fix: The link problem exists for the fd, ft and st devices. The following patch corrects the problem. The patch is against this version. $Id: MAKEDEV,v 1.127.2.20 1998/07/06 10:59:17 des Exp $ --- /usr/src/etc/etc.i386/MAKEDEV.orig Mon Oct 12 16:57:47 1998 +++ /usr/src/etc/etc.i386/MAKEDEV Fri Oct 23 02:59:42 1998 @@ -342,8 +342,8 @@ # Fake BSD partitions for i in a b c d e f g h do - ln ${name}${unit} ${name}${unit}$i - ln r${name}${unit} r${name}${unit}$i + ln -f ${name}${unit} ${name}${unit}$i + ln -f r${name}${unit} r${name}${unit}$i done # User-readable and programmer-readable name sets @@ -422,8 +422,8 @@ 0|1|2|3) mknod ${name}${unit} b $blk `expr $unit '*' 64 + 32` mknod r${name}${unit} c $chr `expr $unit '*' 64 + 32` - ln ${name}${unit} ${name}${unit}a - ln r${name}${unit} r${name}${unit}a + ln -f ${name}${unit} ${name}${unit}a + ln -f r${name}${unit} r${name}${unit}a chgrp operator ${name}${unit}* r${name}${unit}* ;; *) @@ -586,9 +586,9 @@ mknod rst${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl ` chmod 600 rst${unit}.ctl - ln rst${unit}.0 rst${unit} - ln nrst${unit}.0 nrst${unit} - ln erst${unit}.0 erst${unit} + ln -f rst${unit}.0 rst${unit} + ln -f nrst${unit}.0 nrst${unit} + ln -f erst${unit}.0 erst${unit} ;; *) echo bad unit for tape in: $i >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message