summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2002-06-28 20:06:47 +0000
committerIan Dowse <iedowse@FreeBSD.org>2002-06-28 20:06:47 +0000
commit84b2995b2f288b8e37a7da86eeb0f816a33cb44b (patch)
treebae8117b476354108de4855889b02267fea89758
parent0080a004d7c5ee42728876b1111cd3b04e8cf898 (diff)
Notes
-rw-r--r--sys/kern/vfs_extattr.c10
-rw-r--r--sys/kern/vfs_syscalls.c10
2 files changed, 18 insertions, 2 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 05e4fb65ec8b..41e4d285a8b6 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -3652,7 +3652,15 @@ restart:
if (vp != NULL) {
NDFREE(&nd, NDF_ONLY_PNBUF);
vrele(vp);
- vput(nd.ni_dvp);
+ /*
+ * XXX namei called with LOCKPARENT but not LOCKLEAF has
+ * the strange behaviour of leaving the vnode unlocked
+ * if the target is the same vnode as the parent.
+ */
+ if (vp == nd.ni_dvp)
+ vrele(nd.ni_dvp);
+ else
+ vput(nd.ni_dvp);
return (EEXIST);
}
if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) {
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 05e4fb65ec8b..41e4d285a8b6 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -3652,7 +3652,15 @@ restart:
if (vp != NULL) {
NDFREE(&nd, NDF_ONLY_PNBUF);
vrele(vp);
- vput(nd.ni_dvp);
+ /*
+ * XXX namei called with LOCKPARENT but not LOCKLEAF has
+ * the strange behaviour of leaving the vnode unlocked
+ * if the target is the same vnode as the parent.
+ */
+ if (vp == nd.ni_dvp)
+ vrele(nd.ni_dvp);
+ else
+ vput(nd.ni_dvp);
return (EEXIST);
}
if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) {