summaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-27 14:54:02 -0700
committerDavid S. Miller <davem@davemloft.net>2008-04-27 15:09:15 -0700
commitfd7354108aa5497d7177b95a6b157eaf8597d621 (patch)
tree0a068f4fcf29fae36794a0b653e6e4f136b62241 /arch/sparc64
parent90888816ba1bf1c4eff1e7e4220c1afc802f0fd3 (diff)
downloadlinux-fd7354108aa5497d7177b95a6b157eaf8597d621.tar.gz
linux-fd7354108aa5497d7177b95a6b157eaf8597d621.tar.bz2
linux-fd7354108aa5497d7177b95a6b157eaf8597d621.zip
sparc64: Fix accidental syscall restart on child return from clone/fork/vfork.
This fixes a regression added by 238468b2ac76020c192a7402c92df5097916bf4a ("[SPARC64]: Use trap type stored in pt_regs to handle syscall restart.") Because we now encode the "returning from syscall" status in the pt_regs area, we have to be mindful to zap it out in the child of a fork. During a parallel kernel build I saw an accidental -EINTR return from vfork() in 'make' because of this bug. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/process.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 500ac6d483a0..056013749157 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -591,6 +591,12 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
if (clone_flags & CLONE_SETTLS)
t->kregs->u_regs[UREG_G7] = regs->u_regs[UREG_I3];
+ /* We do not want to accidently trigger system call restart
+ * handling in the new thread. Therefore, clear out the trap
+ * type, which will make pt_regs_regs_is_syscall() return false.
+ */
+ pt_regs_clear_trap_type(t->kregs);
+
return 0;
}