avoid problems in lookup from programs referencing the hidden vnode
SCCS-vsn: sys/kern/vfs_syscalls.c 8.25
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)vfs_syscalls.c 8.24 (Berkeley) %G%
+ * @(#)vfs_syscalls.c 8.25 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
vput(vp);
return (ENODEV);
}
vput(vp);
return (ENODEV);
}
+ if (vp->v_usecount > 1 || vp->v_mountedhere != NULL) {
+ vput(vp);
+ return (EBUSY);
+ }
/*
* Allocate and initialize the file system.
/*
* Allocate and initialize the file system.
vput(vp);
return (error);
}
vput(vp);
return (error);
}
- if (vp->v_mountedhere != NULL) {
- vfs_unlock(mp);
- free((caddr_t)mp, M_MOUNT);
- vput(vp);
- return (EBUSY);
- }
vp->v_mountedhere = mp;
mp->mnt_vnodecovered = vp;
mp->mnt_stat.f_owner = p->p_ucred->cr_uid;
vp->v_mountedhere = mp;
mp->mnt_vnodecovered = vp;
mp->mnt_stat.f_owner = p->p_ucred->cr_uid;