Skip to content

Commit

Permalink
Fix timeouts in sys_pselect7
Browse files Browse the repository at this point in the history
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 8ff3e8e
("select: switch select() and poll() over to hrtimers").

Signed-off-by: Bernd Schmidt <[email protected]>
Reviewed-by: Ulrich Drepper <[email protected]>
Tested-by: Robin Getz <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
bernds authored and torvalds committed Jan 13, 2009
1 parent 125c97d commit 6256851
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ asmlinkage long sys_pselect7(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) {
Expand Down

0 comments on commit 6256851

Please sign in to comment.