vfs: don't use a mountpoint if it's in use for anything else.

(this avoids data structure confusion if a mountpoint is reused as
a mountpoint until that's properly fixed.)
This commit is contained in:
Ben Gras 2010-06-11 11:41:56 +00:00
parent 4d7c317700
commit 19b790eb53

View file

@ -253,6 +253,12 @@ PRIVATE int mount_fs(endpoint_t fs_e)
/* Get vnode of mountpoint */ /* Get vnode of mountpoint */
if ((vp = eat_path(PATH_NOFLAGS)) == NULL) return(err_code); if ((vp = eat_path(PATH_NOFLAGS)) == NULL) return(err_code);
if (vp->v_ref_count != 1) {
put_vnode(vp);
return(EBUSY);
}
/* Tell FS on which vnode it is mounted (glue into mount tree) */ /* Tell FS on which vnode it is mounted (glue into mount tree) */
if ((r = req_mountpoint(vp->v_fs_e, vp->v_inode_nr)) != OK) { if ((r = req_mountpoint(vp->v_fs_e, vp->v_inode_nr)) != OK) {
put_vnode(vp); put_vnode(vp);