summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Schmidt <bernds_cb1@t-online.de>2009-01-13 22:14:48 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-18 10:44:02 -0800
commitb6d5532bc4dcf61d53651593f9d7aee42fe40e03 (patch)
treeb9de6373adc062b37dd37213eb38ee4eda7d40a5
parent703726d14c4ec5320dec747268d219899f6e8f82 (diff)
Fix timeouts in sys_pselect7
commit 62568510b8e2679cbc331d7de10ea9ba81ae8b3d upstream. Since we (Analog Devices) updated our Blackfin kernel to 2.6.28, we've seen occasional 5-second hangs from telnet. telnetd calls select with a NULL timeout, but with the new kernel, the system call occasionally returns 0, which causes telnet to call sleep (5). This did not happen with earlier kernels. The code in sys_pselect7 looks a bit strange, in particular the variable "to" is initialized to NULL, then changed if a non-null timeout was passed in, but not used further. It needs to be passed to core_sys_select instead of &end_time. This bug was introduced by 8ff3e8e85fa6c312051134b3953e397feb639f51 ("select: switch select() and poll() over to hrtimers"). Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com> Reviewed-by: Ulrich Drepper <drepper@redhat.com> Tested-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--fs/select.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/select.c b/fs/select.c
index 3da402681dd2..b140f906afd3 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -560,7 +560,7 @@ static long do_pselect(int n, fd_set __user *inp, fd_set __user *outp,
sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved);
}
- ret = core_sys_select(n, inp, outp, exp, &end_time);
+ ret = core_sys_select(n, inp, outp, exp, to);
ret = poll_select_copy_remaining(&end_time, tsp, 0, ret);
if (ret == -ERESTARTNOHAND) {