summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2003-01-28 09:21:42 +0000
committertjr <tjr@FreeBSD.org>2003-01-28 09:21:42 +0000
commit7c38f578b5877b50b60f04abe40a312d23222720 (patch)
tree048cfc3375d61c32327f09a15bb024e59bddd1c3
parent23ad122bb92148a7ed9b210749bff81edd4c963e (diff)
downloadFreeBSD-src-7c38f578b5877b50b60f04abe40a312d23222720.zip
FreeBSD-src-7c38f578b5877b50b60f04abe40a312d23222720.tar.gz
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
-rw-r--r--sys/fs/pseudofs/pseudofs_vncache.c3
1 files changed, 2 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud