From owner-freebsd-bugs Fri Apr 26 4:39:54 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 2C09D37B404; Fri, 26 Apr 2002 04:39:45 -0700 (PDT) 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 VAA12428; Fri, 26 Apr 2002 21:39:41 +1000 Date: Fri, 26 Apr 2002 21:40:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: "Greg 'groggy' Lehey" Cc: Poul-Henning Kamp , Subject: Re: bin/37458: twed (3ware escalade) devices not supported by vinum In-Reply-To: <20020426090420.R33950@wantadilla.lemis.com> Message-ID: <20020426212651.F4109-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 Fri, 26 Apr 2002, Greg 'groggy' Lehey wrote: > On Thursday, 25 April 2002 at 11:30:08 -0700, Poul-Henning Kamp wrote: > > The following reply was made to PR bin/37458; it has been noted by GNATS. > > > > From: Poul-Henning Kamp > > To: holger.kipp@alogis.com > > Cc: FreeBSD-gnats-submit@FreeBSD.ORG > > Subject: Re: bin/37458: twed (3ware escalade) devices not supported by vinum > > Date: Thu, 25 Apr 2002 20:21:55 +0200 > > > > While this patch is technically correct, the code it patches is > > mightily bogus. > >> *** vinumio.c.orig Tue Apr 23 13:05:19 2002 > >> --- vinumio.c Tue Apr 23 13:22:57 2002 > >> *************** > >> *** 93,98 **** > >> --- 93,101 ---- > >> } else if (bcmp(dname, "idad", 4) == 0) { > >> devmajor = 109; > >> dname += 2; > >> + } else if (bcmp(dname, "twed", 4) == 0) { /* 3ware raid */ > >> + devmajor = 147; > >> + dname += 2; > >> } else > > You obviously haven't read the comments. > > /* > * Yes, Bruce, I know this is horrible, but we > * don't have a root file system when we first > * try to do this. If you can come up with a > * better solution, I'd really like it. I'm > * just putting it in now to add ammuntion to > * moving the system to devfs. > */ It can be done less worse by looking up the driver name in the cdevsw, as in vfs_conf.c:vfs_mountroot_ask(): printf("Possibly valid devices for 'ufs' root:\n"); for (i = 0; i < NUMCDEVSW; i++) { dev = makedev(i, 0); if (devsw(dev) != NULL) printf(" \"%s\"", devsw(dev)->d_name); } printf("\n"); This code has some style bugs and bogusly prints _all_ _driver names_ as candidates for root devices. Fix: %%% Index: vfs_conf.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_conf.c,v retrieving revision 1.68 diff -u -2 -r1.68 vfs_conf.c --- vfs_conf.c 17 Apr 2002 13:06:36 -0000 1.68 +++ vfs_conf.c 21 Apr 2002 13:58:11 -0000 @@ -284,11 +277,12 @@ printf("\nmountroot> "); gets(name); - if (name[0] == 0) - return(1); + if (name[0] == '\0') + return (1); if (name[0] == '?') { - printf("Possibly valid devices for 'ufs' root:\n"); - for (i = 0; i < NUMCDEVSW; i++) { - dev = makedev(i, 0); - if (devsw(dev) != NULL) + printf("Possibly valid driver names for 'ufs' root:\n"); + for (cd = 0; cd < NUMCDEVSW; cd++) { + dev = makedev(cd, 0); + if (devsw(dev) != NULL && + devsw(dev)->d_flags & D_DISK) printf(" \"%s\"", devsw(dev)->d_name); } %%% Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message