Subject: kern/7797: Bug in FFSS mount root
To: None <gnats-bugs@gnats.netbsd.org>
From: None <neil@causality.com>
List: netbsd-bugs
Date: 06/16/1999 17:35:41
>Number:         7797
>Category:       kern
>Synopsis:       It's stuffed
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 16 17:35:00 1999
>Last-Modified:
>Originator:     Neil Carson
>Organization:
None
>Release:        1.4
>Environment:
Pretty normal
System: NetBSD bambleweeny.brini.com 1.4 NetBSD 1.4 (BAMBLEWEENY) #5: Tue May 18 02:16:13 PDT 1999 root@bambleweeny.brini.com:/usr/src/sys/arch/i386/compile/BAMBLEWEENY i386

>Description:
	If falling back from FFS onto another FS during root mount,
	the root vnode doesn't get released thus causing the other
	root mounts to panic later on.
>How-To-Repeat:
	
>Fix:
	Change mountroot in FFS to:

	/*
	 * Get vnodes for rootdev.
	 */
	if (bdevvp(rootdev, &rootvp))
		panic("ffs_mountroot: can't setup bdevvp's");

	if ((error = vfs_rootmountalloc(MOUNT_FFS, "root_device", &mp)))
		return (error);
	if ((error = ffs_mountfs(rootvp, mp, p)) != 0) {
		mp->mnt_op->vfs_refcount--;
		vfs_unbusy(mp);
		free(mp, M_MOUNT);
		vrele(rootvp);
		return (error);
	}


>Audit-Trail:
>Unformatted: