--- src/sys/vfs/nullfs/null_vfsops.c 2006/07/18 22:22:15 1.22 +++ src/sys/vfs/nullfs/null_vfsops.c 2006/08/09 22:47:35 1.23 @@ -172,6 +172,7 @@ static int nullfs_root(struct mount *mp, struct vnode **vpp) { struct vnode *vp; + int error; NULLFSDEBUG("nullfs_root(mp = %p, vp = %p)\n", (void *)mp, (void *)MOUNTTONULLMOUNT(mp)->nullm_rootvp); @@ -180,18 +181,10 @@ nullfs_root(struct mount *mp, struct vno * Return locked reference to root. */ vp = MOUNTTONULLMOUNT(mp)->nullm_rootvp; - vref(vp); - -#ifdef NULLFS_DEBUG - if (VOP_ISLOCKED(vp, NULL)) { - Debugger("root vnode is locked.\n"); - vrele(vp); - return (EDEADLK); - } -#endif - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - *vpp = vp; - return 0; + error = vget(vp, LK_EXCLUSIVE | LK_RETRY); + if (error == 0) + *vpp = vp; + return (error); } static int