From 7c38f578b5877b50b60f04abe40a312d23222720 Mon Sep 17 00:00:00 2001 From: tjr Date: Tue, 28 Jan 2003 09:21:42 +0000 Subject: Do not allow a cached vnode to be shared among multiple mounts of the same kind of pseudofs-based filesystem. Fixes (at least) one problem where when procfs is mounted mupltiple times, trying to unmount one will often cause the wrong one to get unmounted, and other problem where mounting one procfs on top of another caused the kernel to lock up. Reviewed by: des --- sys/fs/pseudofs/pseudofs_vncache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/fs/pseudofs/pseudofs_vncache.c b/sys/fs/pseudofs/pseudofs_vncache.c index a1be1f1..eed7aef 100644 --- a/sys/fs/pseudofs/pseudofs_vncache.c +++ b/sys/fs/pseudofs/pseudofs_vncache.c @@ -113,7 +113,8 @@ pfs_vncache_alloc(struct mount *mp, struct vnode **vpp, */ mtx_lock(&pfs_vncache_mutex); for (pvd = pfs_vncache; pvd; pvd = pvd->pvd_next) { - if (pvd->pvd_pn == pn && pvd->pvd_pid == pid) { + if (pvd->pvd_pn == pn && pvd->pvd_pid == pid && + pvd->pvd_vnode->v_mount == mp) { if (vget(pvd->pvd_vnode, 0, curthread) == 0) { ++pfs_vncache_hits; *vpp = pvd->pvd_vnode; -- cgit v1.1