When attempting to guess the filesystem type from the disklabel, don't

consider a out-of-range partition letter at the end of the special
device node to be a fatal error; just return NULL and let the caller
fall back to FFS.

This fixes the "mount -u /kern/rootdev /" done by the script installer.

XXX this is still gross, and breaks things like
"mount /my/strange/dev/path/b /mnt". Perhaps it should stat the node
and use the minor number as an index instead?
This commit is contained in:
nathanw 2002-05-21 23:51:19 +00:00
parent 936b7f4cf8
commit be856ef968
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mount.c,v 1.58 2002/01/30 21:40:31 christos Exp $ */
/* $NetBSD: mount.c,v 1.59 2002/05/21 23:51:19 nathanw Exp $ */
/*
* Copyright (c) 1980, 1989, 1993, 1994
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1989, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95";
#else
__RCSID("$NetBSD: mount.c,v 1.58 2002/01/30 21:40:31 christos Exp $");
__RCSID("$NetBSD: mount.c,v 1.59 2002/05/21 23:51:19 nathanw Exp $");
#endif
#endif /* not lint */
@ -611,7 +611,7 @@ getfslab(str)
part = str[strlen(str) - 1] - 'a';
if (part < 0 || part >= dl.d_npartitions)
errx(1, "partition `%s' is not defined on disk", str);
return (NULL);
/* Return NULL for unknown types - caller can fall back to ffs */
if ((fstype = dl.d_partitions[part].p_fstype) >= FSMAXMOUNTNAMES)