diff options
author | kan <kan@FreeBSD.org> | 2005-08-14 18:10:04 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2005-08-14 18:10:04 +0000 |
commit | 5f5eca170ab59694b1e50d6c0abb53b0e4863f9c (patch) | |
tree | efb3da5b3985383cc20d6366c1e35691d9243850 /sys | |
parent | a2b7d697913d661fda3cdf89df1b40035f6c116a (diff) | |
download | FreeBSD-src-5f5eca170ab59694b1e50d6c0abb53b0e4863f9c.zip FreeBSD-src-5f5eca170ab59694b1e50d6c0abb53b0e4863f9c.tar.gz |
Do not keep parent directory locked while calling VFS_ROOT to traverse mount
points in lookup(). The lock can be dropped safely around VFS_ROOT because
LOCKPARENT semantics with child and perent vnodes coming from different FSes
does not really have any meaningful use. On the other hard, this prevents
easily triggered deadlock on systems using automounter daemon.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_lookup.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 078fc10..19dac65 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -617,7 +617,9 @@ unionlookup: tvfslocked = VFS_LOCK_GIANT(mp); VFS_UNLOCK_GIANT(vfslocked); vfslocked = tvfslocked; + 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); if (error) { dpunlocked = 1; |