Skip to contentSkip to conversation

Fix timeouts in sys_pselect7

PATCH Bernd Schmidt 3 participants 3 messages Jan 13, 2009 VFS

lore
Share & tools
lore
#0 lore raw

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. The patch below passes it to core_sys_select instead of &end_time, and this appears to fix the problem. Does this look like the correct approach?

Signature · 4 lines
This footer brought to you by insane German lawmakers.
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
 fs/select.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/select.c +1 -1
index 08b91be..b0cf1f0 100644
@@ -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) {
Tested-by
#2 lore raw

On Tue 13 Jan 2009 14:38, Ulrich Drepper pondered:

Quoted 10 lines · Bernd Schmidt
Quoted 3 lines

The patch below passes it to
core_sys_select instead of &end_time, and this appears to fix the problem. Does this look like the correct approach?

Yes, that change is correct.

Quoted 1 line

I'm assuming this should go into stable then?