summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorethindra <none@none>2007-05-10 18:49:25 -0700
committerethindra <none@none>2007-05-10 18:49:25 -0700
commitaa47d34086d87750d5d3721b607c057e282e1048 (patch)
tree4b95a07aa445b9994bb1c8bbfde3aa0e2c4ec4ea /usr/src
parent317596c51a93f4ad2b6601ca7fe483cea905b2f5 (diff)
downloadillumos-gate-aa47d34086d87750d5d3721b607c057e282e1048.tar.gz
6533743 Deadlock involving a file_t f_tlock and P_PR_LOCK in case of fork failure
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/os/fork.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr/src/uts/common/os/fork.c b/usr/src/uts/common/os/fork.c
index aae3f69a59..77c22aa7bb 100644
--- a/usr/src/uts/common/os/fork.c
+++ b/usr/src/uts/common/os/fork.c
@@ -272,6 +272,8 @@ cfork(int isvfork, int isfork1, int flags)
error = as_dup(p->p_as, &cp->p_as);
if (error != 0) {
+ mutex_enter(&p->p_lock);
+ sprunlock(p);
fork_fail(cp);
mutex_enter(&pidlock);
orphpp = &p->p_orphan;
@@ -298,7 +300,7 @@ cfork(int isvfork, int isfork1, int flags)
p->p_flag &= ~SFORKING;
pool_barrier_exit();
continuelwps(p);
- sprunlock(p);
+ mutex_exit(&p->p_lock);
/*
* Preserve ENOMEM error condition but
* map all others to EAGAIN.