From owner-freebsd-bugs Thu Jan 10 23:47:50 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 6954837B402 for ; Thu, 10 Jan 2002 23:47:47 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id SAA17098; Fri, 11 Jan 2002 18:47:41 +1100 Date: Fri, 11 Jan 2002 18:48:22 +1100 (EST) From: Bruce Evans X-X-Sender: To: Cc: Subject: Re: conf/20436: Can't make only cd0 under 4.1-STABLE In-Reply-To: <20020110130543.A11553@blossom.cjclark.org> Message-ID: <20020111181807.C625-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Thu, 10 Jan 2002, Crist J . Clark wrote: > On Fri, Jan 11, 2002 at 12:07:56AM +1100, Bruce Evans wrote: > > On Thu, 10 Jan 2002, Crist J . Clark wrote: > > (1) "sh MAKEDEV cdN" still makes N units numbered 0 to N-1 instead of unit > > N like one would expect. > > Actually, it makes devices 0 to N. Ugh. I forgot that this regressed in a previous wrong fix for this bug suite (rev.1.249). This bug has apparently been copied to give an off by one error in the number of units for bpf, tap and tun as well as acd*t. It is missing for older synthetic devices like vty and pty (bpf is old but was originally handled better by making only one unit). > > (2) The bug is also in acd*t*. > > Several other devices are made this way like the vty's. Then there are > some really weird unit numbers, like the pty's. Synthetic devices are free and the maxiumum number that you can use (but not want :-) changes often, so it is reasonable to have a very easy way (easier than iterating MAKEDEV using jot -mumble) to create lots of them. However, I think the implementation is bad. There should be a case statement to make only the Nth device. General code could then handle the iteration. > However, I could see going to only creating node 'N' since this is > what the HDD devices (da, ad) and even wcd and matcd do. This would be going back to the old behaviour for cd. cd used to be handled like da, but was broken without discussion or logging in rev.1.171 (part of the big first CAM commit). It's silly for cdrom devices to be easier to create than hard disk devices. We support up to 512 hard disk devices per driver type but only 32 cdrom devices per driver type. I guess systems with multiple hard disks are much more common than multiple cdroms. > So if we are actually going to go an change this behavior, > [code deleted] OK with me, but this is moot in -current since devfs is standard in -current. It's too late to fix it properly in RELENG_4. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message