summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2002-10-22 01:06:44 +0000
committermckusick <mckusick@FreeBSD.org>2002-10-22 01:06:44 +0000
commit76a6cc0dc172d9a26b57c6064948c52bb19a87e5 (patch)
treefed70d49a972fe3a75ee2a1516cdb0e0e5ebcdb5 /sys/kern
parent305e5868f30dc7852e251f3a6500661328b28866 (diff)
downloadFreeBSD-src-76a6cc0dc172d9a26b57c6064948c52bb19a87e5.zip
FreeBSD-src-76a6cc0dc172d9a26b57c6064948c52bb19a87e5.tar.gz
This update removes a race between unmount and lookup. The lookup
locks the mount point directory while waiting for vfs_busy to clear. Meanwhile the unmount which holds the vfs_busy lock tried to lock the mount point vnode. The fix is to observe that it is safe for the unmount to remove the vnode from the mount point without locking it. The lookup will wait for the unmount to complete, then recheck the mount point when the vfs_busy lock clears. Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_mount.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 96a6c4b..d623508 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1317,11 +1317,8 @@ dounmount(mp, flags, td)
crfree(mp->mnt_cred);
mtx_lock(&mountlist_mtx);
TAILQ_REMOVE(&mountlist, mp, mnt_list);
- if ((coveredvp = mp->mnt_vnodecovered) != NULL) {
- vn_lock(coveredvp, LK_EXCLUSIVE|LK_RETRY, td);
+ if ((coveredvp = mp->mnt_vnodecovered) != NULL)
coveredvp->v_mountedhere = NULL;
- VOP_UNLOCK(coveredvp, 0, td);
- }
mp->mnt_vfc->vfc_refcount--;
if (!TAILQ_EMPTY(&mp->mnt_nvnodelist))
panic("unmount: dangling vnode");
OpenPOWER on IntegriCloud