The patch titled Use ERESTARTNOHAND if poll() is interrupted by a signal has been added to the -mm tree. Its filename is use-erestartnohand-if-poll-is-interrupted-by-a-signal.patch *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: Use ERESTARTNOHAND if poll() is interrupted by a signal From: Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> poll() returns -EINTR if a signal is pending. EINTR is a bad choice: it means that poll returns to user space if the task is stopped by SIGSTOP/SIGCONT or by the freezer. select() and ppoll() both use ERESTARTNOHAND, this avoids a return to user space for signals that are handled by the kernel. The patch switches poll() to ERESTARTNOHAND. Tested with FC6. Patch against 2.6.23-rc1-mm1. Signed-off-by: Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Roland McGrath <roland@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/select.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff -puN fs/select.c~use-erestartnohand-if-poll-is-interrupted-by-a-signal fs/select.c --- a/fs/select.c~use-erestartnohand-if-poll-is-interrupted-by-a-signal +++ a/fs/select.c @@ -621,7 +621,7 @@ static int do_poll(unsigned int nfds, s if (!count) { count = wait->error; if (signal_pending(current)) - count = -EINTR; + count = -ERESTARTNOHAND; } if (count || !*timeout) break; @@ -774,7 +774,7 @@ asmlinkage long sys_ppoll(struct pollfd ret = do_sys_poll(ufds, nfds, &timeout); /* We can restart this syscall, usually */ - if (ret == -EINTR) { + if (ret == -ERESTARTNOHAND) { /* * Don't restore the signal mask yet. Let do_signal() deliver * the signal on the way back to userspace, before the signal @@ -785,7 +785,6 @@ asmlinkage long sys_ppoll(struct pollfd sizeof(sigsaved)); set_thread_flag(TIF_RESTORE_SIGMASK); } - ret = -ERESTARTNOHAND; } else if (sigmask) sigprocmask(SIG_SETMASK, &sigsaved, NULL); _ Patches currently in -mm which might be from manfred@xxxxxxxxxxxxxxxx are use-erestartnohand-if-poll-is-interrupted-by-a-signal.patch mm-debug-dump-pageframes-on-bad_page.patch slab-leaks3-default-y.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html