diff options
author | Jason Baron <jbaron@redhat.com> | 2012-03-16 16:34:03 -0400 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2012-10-07 23:41:07 +0200 |
commit | bf2acb54cd4a7569f8d222943051b489030fcd12 (patch) | |
tree | 7612a62a58c84de2243d04a2563f822896e68680 /fs | |
parent | 0dc301f09ada92857af9356d8d2bcb20e016ab13 (diff) |
Don't limit non-nested epoll paths
commit 93dc6107a76daed81c07f50215fa6ae77691634f upstream.
Commit 28d82dc1c4ed ("epoll: limit paths") that I did to limit the
number of possible wakeup paths in epoll is causing a few applications
to longer work (dovecot for one).
The original patch is really about limiting the amount of epoll nesting
(since epoll fds can be attached to other fds). Thus, we probably can
allow an unlimited number of paths of depth 1. My current patch limits
it at 1000. And enforce the limits on paths that have a greater depth.
This is captured in: https://bugzilla.redhat.com/show_bug.cgi?id=681578
Signed-off-by: Jason Baron <jbaron@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/eventpoll.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 8da83d88d5c..802b28d460d 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -975,6 +975,10 @@ static int path_count[PATH_ARR_SIZE]; static int path_count_inc(int nests) { + /* Allow an arbitrary number of depth 1 paths */ + if (nests == 0) + return 0; + if (++path_count[nests] > path_limits[nests]) return -1; return 0; |