summaryrefslogtreecommitdiff
path: root/fs/eventpoll.c
diff options
context:
space:
mode:
authorJason Baron <jbaron@redhat.com>2012-04-25 16:01:47 -0700
committerWilly Tarreau <w@1wt.eu>2012-10-07 23:41:07 +0200
commit265c3d3918028d673fdc484b197436a7eb34a7a0 (patch)
tree1bb42b0d82145b46822bd58d5bcbcadcde62ead5 /fs/eventpoll.c
parentbf2acb54cd4a7569f8d222943051b489030fcd12 (diff)
epoll: clear the tfile_check_list on -ELOOP
commit 13d518074a952d33d47c428419693f63389547e9 upstream. An epoll_ctl(,EPOLL_CTL_ADD,,) operation can return '-ELOOP' to prevent circular epoll dependencies from being created. However, in that case we do not properly clear the 'tfile_check_list'. Thus, add a call to clear_tfile_check_list() for the -ELOOP case. Signed-off-by: Jason Baron <jbaron@redhat.com> Reported-by: Yurij M. Plotnikov <Yurij.Plotnikov@oktetlabs.ru> Cc: Nelson Elhage <nelhage@nelhage.com> Cc: Davide Libenzi <davidel@xmailserver.org> Tested-by: Alexandra N. Kossovsky <Alexandra.Kossovsky@oktetlabs.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'fs/eventpoll.c')
-rw-r--r--fs/eventpoll.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 802b28d460d9..ff57421c0c52 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1577,8 +1577,10 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
if (op == EPOLL_CTL_ADD) {
if (is_file_epoll(tfile)) {
error = -ELOOP;
- if (ep_loop_check(ep, tfile) != 0)
+ if (ep_loop_check(ep, tfile) != 0) {
+ clear_tfile_check_list();
goto error_tgt_fput;
+ }
} else
list_add(&tfile->f_tfile_llink, &tfile_check_list);
}