Don't limit non-nested epoll paths
authorJason Baron <jbaron@redhat.com>
Fri, 16 Mar 2012 20:34:03 +0000 (16:34 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 18 Mar 2012 19:25:04 +0000 (12:25 -0700)
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>
fs/eventpoll.c

index ea54cdef04ddc94d282c22f8c2b721169ee77293..4d9d3a45e35647a19d9182e28422c397f654abb5 100644 (file)
@@ -988,6 +988,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;
This page took 0.026661 seconds and 5 git commands to generate.