public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] sys_epoll_wait() timeout saga ...
@ 2005-09-23 18:13 Davide Libenzi
  2005-09-23 18:24 ` Nish Aravamudan
  2005-09-24  4:05 ` Willy Tarreau
  0 siblings, 2 replies; 33+ messages in thread
From: Davide Libenzi @ 2005-09-23 18:13 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Andrew Morton

[-- Attachment #1: Type: TEXT/PLAIN, Size: 249 bytes --]


The sys_epoll_wait() function was not handling correctly negative timeouts 
(besides -1), and like sys_poll(), was comparing millisec to secs in 
testing the upper timeout limit.


Signed-off-by: Davide Libenzi <davidel@xmailserver.org>


- Davide

[-- Attachment #2: Type: TEXT/PLAIN, Size: 475 bytes --]

--- a/fs/eventpoll.c	2005-09-23 10:56:57.000000000 -0700
+++ b/fs/eventpoll.c	2005-09-23 11:00:06.000000000 -0700
@@ -1507,7 +1507,7 @@
 	 * and the overflow condition. The passed timeout is in milliseconds,
 	 * that why (t * HZ) / 1000.
 	 */
-	jtimeout = timeout == -1 || timeout > (MAX_SCHEDULE_TIMEOUT - 1000) / HZ ?
+	jtimeout = timeout < 0 || (timeout / 1000) >= (MAX_SCHEDULE_TIMEOUT / HZ) ?
 		MAX_SCHEDULE_TIMEOUT: (timeout * HZ + 999) / 1000;
 
 retry:

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2005-10-01 20:45 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-23 18:13 [patch] sys_epoll_wait() timeout saga Davide Libenzi
2005-09-23 18:24 ` Nish Aravamudan
2005-09-24  4:05 ` Willy Tarreau
2005-09-24  4:44   ` Nish Aravamudan
2005-09-24  6:15     ` Willy Tarreau
2005-09-24  7:33       ` Vadim Lobanov
2005-09-24  7:51         ` Willy Tarreau
2005-09-24 15:10       ` Davide Libenzi
2005-09-24 17:20         ` Willy Tarreau
2005-09-24 18:19           ` Davide Libenzi
2005-09-25  6:05             ` Andrew Morton
2005-09-25  6:20               ` Willy Tarreau
2005-09-25  6:32                 ` Andrew Morton
2005-09-25  7:08               ` Vadim Lobanov
2005-09-25  8:03                 ` Willy Tarreau
2005-09-24 17:19       ` Nishanth Aravamudan
2005-09-24 18:25         ` Davide Libenzi
2005-09-24 19:38           ` [PATCH 0/3] fixes for overflow in poll(), epoll(), and msec_to_jiffies() Willy Tarreau
2005-09-24 19:44             ` [PATCH 1/3] 2.6.14-rc2-mm1: fixes for overflow msec_to_jiffies() Willy Tarreau
2005-09-29  9:43               ` Andrew Morton
2005-09-29 19:41                 ` Willy Tarreau
2005-09-29 19:52                   ` Andrew Morton
2005-09-29 20:55                     ` Willy Tarreau
2005-10-01 17:39                     ` Willy Tarreau
2005-09-24 19:47             ` [PATCH 2/3] 2.6.14-rc2-mm1: fixes for overflow in epoll() Willy Tarreau
2005-09-24 19:52             ` [PATCH 3/3] 2.6.14-rc2-mm1 : fixes for overflow in sys_poll() Willy Tarreau
2005-10-01 20:39               ` Willy Tarreau
2005-09-24 20:08             ` [PATCH 0/3] fixes for overflow in poll(), epoll(), and msec_to_jiffies() Davide Libenzi
2005-09-24 20:21               ` Willy TARREAU
2005-09-25 20:55             ` Nishanth Aravamudan
2005-09-25 22:06               ` Willy Tarreau
2005-09-24 21:25           ` [patch] sys_epoll_wait() timeout saga Vadim Lobanov
2005-09-24 18:30         ` Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox