Index: vfs_mount.c =================================================================== RCS file: /usr/repo/src/sys/kern/vfs_mount.c,v retrieving revision 1.190 diff -u -p -r1.190 vfs_mount.c --- vfs_mount.c 19 Apr 2005 06:23:59 -0000 1.190 +++ vfs_mount.c 19 Apr 2005 12:26:49 -0000 @@ -1012,11 +1012,16 @@ struct root_hold_token { static LIST_HEAD(, root_hold_token) root_holds = LIST_HEAD_INITIALIZER(&root_holds); +static boolean_t root_mounted = 0; + struct root_hold_token * root_mount_hold(const char *identifier) { struct root_hold_token *h; + /* If root is already mounted, there is nothing to hold. */ + if (root_mounted) + return (NULL); h = malloc(sizeof *h, M_DEVBUF, M_ZERO | M_WAITOK); h->who = identifier; mtx_lock(&mountlist_mtx); @@ -1029,6 +1034,9 @@ void root_mount_rel(struct root_hold_token *h) { + /* Ignore NULL tokens. */ + if (h == NULL) + return; mtx_lock(&mountlist_mtx); LIST_REMOVE(h, list); wakeup(&root_holds); @@ -1330,6 +1338,8 @@ vfs_mountroot_try(const char *mountfrom) } while (mp != NULL); devfs_fixup(curthread); + + root_mounted = 1; } return (error); }