summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2006-03-31 02:59:23 +0000
committerjeff <jeff@FreeBSD.org>2006-03-31 02:59:23 +0000
commit73f46586c6a7502142873c6d714c639b83e8e1e0 (patch)
tree16909223767dc5fa5f6b7c5d75dff8eb7ba84491
parent2086f279cf6f34c84b68782651af859bd337032d (diff)
downloadFreeBSD-src-73f46586c6a7502142873c6d714c639b83e8e1e0.zip
FreeBSD-src-73f46586c6a7502142873c6d714c639b83e8e1e0.tar.gz
- LK_RETRY means nothing when passed to VOP_LOCK. Call vn_lock instead.
- Move the vn_lock of the dvp until after we've unbusied the filesystem to avoid a LOR with the mount point lock. - In the v_mountedhere while loop we acquire a new instance of giant each time through without releasing the first. This would cause us to leak Giant. Sponsored by: Isilon Systems, Inc.
-rw-r--r--sys/kern/vfs_lookup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 4d47123..29cf22b 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -639,12 +639,13 @@ unionlookup:
if (vfs_busy(mp, 0, 0, td))
continue;
vput(dp);
+ VFS_UNLOCK_GIANT(dvfslocked);
dvfslocked = vfslocked;
vfslocked = VFS_LOCK_GIANT(mp);
VOP_UNLOCK(ndp->ni_dvp, 0, td);
error = VFS_ROOT(mp, cnp->cn_lkflags, &tdp, td);
- VOP_LOCK(ndp->ni_dvp, cnp->cn_lkflags | LK_RETRY, td);
vfs_unbusy(mp, td);
+ vn_lock(ndp->ni_dvp, cnp->cn_lkflags | LK_RETRY, td);
if (error) {
dpunlocked = 1;
goto bad2;
OpenPOWER on IntegriCloud