From: Paul Mackerras <paulus@samba.org>
To: torvalds@osdl.org
Cc: trini@kernel.crashing.org, benh@kernel.crashing.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] PPC32: cancel syscall restart on signal delivery
Date: Sat, 15 Nov 2003 11:04:21 +1100 [thread overview]
Message-ID: <16309.28037.896731.19038@cargo.ozlabs.ibm.com> (raw)
Linus, please apply.
This patch ensures that the PPC kernel cancels any pending restarted
system call when it delivers a signal. This is the PPC counterpart of
the change that has recently gone into i386 and other architectures.
BTW, do we have a test program that triggers the bug that this fixes?
Thanks,
Paul.
diff -urN linux-2.5/arch/ppc/kernel/signal.c pmac-2.5/arch/ppc/kernel/signal.c
--- linux-2.5/arch/ppc/kernel/signal.c 2003-09-27 19:46:43.000000000 +1000
+++ pmac-2.5/arch/ppc/kernel/signal.c 2003-11-14 23:08:22.000000000 +1100
@@ -569,10 +569,6 @@
regs->result = -EINTR;
regs->gpr[3] = EINTR;
/* note that the cr0.SO bit is already set */
- /* clear any restart function that was set */
- if (ret == ERESTART_RESTARTBLOCK)
- current_thread_info()->restart_block.fn
- = do_no_restart_syscall;
} else {
regs->nip -= 4; /* Back up & retry system call */
regs->result = 0;
@@ -587,6 +583,9 @@
if (signr == 0)
return 0; /* no signals delivered */
+ /* Always make any pending restarted system calls return -EINTR */
+ current_thread_info()->restart_block.fn = do_no_restart_syscall;
+
if ((ka->sa.sa_flags & SA_ONSTACK) && current->sas_ss_size
&& !on_sig_stack(regs->gpr[1]))
newsp = current->sas_ss_sp + current->sas_ss_size;
next reply other threads:[~2003-11-15 0:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-15 0:04 Paul Mackerras [this message]
2003-11-15 0:21 ` Linus Torvalds
2003-11-15 0:31 ` Linus Torvalds
2003-11-15 2:59 ` Paul Mackerras
2003-11-15 3:11 ` Linus Torvalds
2003-11-15 3:25 ` Linus Torvalds
2003-11-15 5:03 ` Paul Mackerras
2003-11-15 5:14 ` Linus Torvalds
2003-11-15 5:47 ` Linus Torvalds
2003-11-15 6:26 ` Paul Mackerras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16309.28037.896731.19038@cargo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=trini@kernel.crashing.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®