aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2005-03-28 13:39:16 +0000
committerJeff Roberson <jeff@FreeBSD.org>2005-03-28 13:39:16 +0000
commitb2255473fbecefb6edd34a06bc5cc8af04abb31e (patch)
treec8f407790ce3e21fd569d53180dc1c77c6b3372e /sys/fs
parentf7b404d88fe65968e90e0c370b091f4e289ec47b (diff)
downloadsrc-b2255473fbecefb6edd34a06bc5cc8af04abb31e.tar.gz
src-b2255473fbecefb6edd34a06bc5cc8af04abb31e.zip
- Don't panic if we can't lock a child in lookup, return an error instead.
- Only unlock the directory if this is a DOTDOT lookup. Previously this code could have deadlocked if there was a DOTDOT lookup with LOCKPARENT set and another thread was locking the other way up the tree. Sponsored by: Isilon Systems, Inc.
Notes
Notes: svn path=/head/; revision=144227
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/coda/coda_vnops.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c
index 389f78bf0224..c8cf74dda4ae 100644
--- a/sys/fs/coda/coda_vnops.c
+++ b/sys/fs/coda/coda_vnops.c
@@ -996,7 +996,7 @@ coda_lookup(struct vop_lookup_args *ap)
* we are ISLASTCN
*/
if (!error || (error == EJUSTRETURN)) {
- if (!(cnp->cn_flags & LOCKPARENT) || !(cnp->cn_flags & ISLASTCN)) {
+ if (cnp->cn_flags & ISDOTDOT) {
if ((error = VOP_UNLOCK(dvp, 0, td))) {
return error;
}
@@ -1006,8 +1006,8 @@ coda_lookup(struct vop_lookup_args *ap)
*/
if (*ap->a_vpp) {
if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, td))) {
- printf("coda_lookup: ");
- panic("unlocked parent but couldn't lock child");
+ vn_lock(dvp, LK_RETRY|LK_EXCLUSIVE, td);
+ return (error);
}
}
} else {
@@ -1015,8 +1015,7 @@ coda_lookup(struct vop_lookup_args *ap)
if (*ap->a_vpp && (*ap->a_vpp != dvp)) {
/* Different, go ahead and lock it. */
if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, td))) {
- printf("coda_lookup: ");
- panic("unlocked parent but couldn't lock child");
+ return (error);
}
}
}