Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9387
b: refs/heads/master
c: e3306dd
h: refs/heads/master
i:
  9385: 4be11b8
  9383: ebb4344
v: v3
  • Loading branch information
Davide Libenzi authored and Linus Torvalds committed Sep 28, 2005
1 parent 2b72bda commit c2bee98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f2d613799af915da1fd78463ba8ec5086a0d6f92
refs/heads/master: e3306dd5f7eb2e699f36a4a313fca4b48b18d5e1
8 changes: 6 additions & 2 deletions trunk/fs/eventpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
/* Maximum number of poll wake up nests we are allowing */
#define EP_MAX_POLLWAKE_NESTS 4

/* Maximum msec timeout value storeable in a long int */
#define EP_MAX_MSTIMEO min(1000ULL * MAX_SCHEDULE_TIMEOUT / HZ, (LONG_MAX - 999ULL) / HZ)


struct epoll_filefd {
struct file *file;
int fd;
Expand Down Expand Up @@ -1506,8 +1510,8 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
* and the overflow condition. The passed timeout is in milliseconds,
* that why (t * HZ) / 1000.
*/
jtimeout = timeout == -1 || timeout > (MAX_SCHEDULE_TIMEOUT - 1000) / HZ ?
MAX_SCHEDULE_TIMEOUT: (timeout * HZ + 999) / 1000;
jtimeout = (timeout < 0 || timeout >= EP_MAX_MSTIMEO) ?
MAX_SCHEDULE_TIMEOUT : (timeout * HZ + 999) / 1000;

retry:
write_lock_irqsave(&ep->lock, flags);
Expand Down

0 comments on commit c2bee98

Please sign in to comment.