aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Baron <jbaron@redhat.com>2012-03-16 16:34:03 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-27 12:51:09 -0400
commitcf11afd6eb852988bc19813acdc62365fac1499d (patch)
treed900c867ad38ae072afd8fb9bdf4592a6ee06343
parentd33bf16c0e06d79705615af0a2ff06dc1ca65194 (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>
-rw-r--r--fs/eventpoll.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 6879d0c5cb5..35a852a2682 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -988,6 +988,10 @@ static int path_count[PATH_ARR_SIZE];
988 988
989static int path_count_inc(int nests) 989static int path_count_inc(int nests)
990{ 990{
991 /* Allow an arbitrary number of depth 1 paths */
992 if (nests == 0)
993 return 0;
994
991 if (++path_count[nests] > path_limits[nests]) 995 if (++path_count[nests] > path_limits[nests])
992 return -1; 996 return -1;
993 return 0; 997 return 0;