diff options
author | alfred <alfred@FreeBSD.org> | 2003-02-15 05:52:56 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2003-02-15 05:52:56 +0000 |
commit | d9a7e5d6275ad9bb5fb49ed6879def1058777294 (patch) | |
tree | e6573e84f9435faccc517948a6e15ec04999d9b3 /sys/kern/vfs_mount.c | |
parent | 40ff51b25dfaa13508d632a1885e2773f419ff02 (diff) | |
download | FreeBSD-src-d9a7e5d6275ad9bb5fb49ed6879def1058777294.zip FreeBSD-src-d9a7e5d6275ad9bb5fb49ed6879def1058777294.tar.gz |
Fix LOR with PROC/filedesc. Introduce fdesc_mtx that will be used as a
barrier between free'ing filedesc structures. Basically if you want to
access another process's filedesc, you want to hold this mutex over the
entire operation.
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r-- | sys/kern/vfs_mount.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index eeece39..eb208cc 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1141,10 +1141,10 @@ checkdirs(olddp, newdp) return; sx_slock(&allproc_lock); LIST_FOREACH(p, &allproc, p_list) { - PROC_LOCK(p); + mtx_lock(&fdesc_mtx); fdp = p->p_fd; if (fdp == NULL) { - PROC_UNLOCK(p); + mtx_unlock(&fdesc_mtx); continue; } nrele = 0; @@ -1160,7 +1160,7 @@ checkdirs(olddp, newdp) nrele++; } FILEDESC_UNLOCK(fdp); - PROC_UNLOCK(p); + mtx_unlock(&fdesc_mtx); while (nrele--) vrele(olddp); } |