diff options
author | Jason Baron <jbaron@redhat.com> | 2012-04-25 19:01:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-26 00:26:33 -0400 |
commit | 13d518074a952d33d47c428419693f63389547e9 (patch) | |
tree | 75ccd438b6579840f51b96eed7a5e760e6caf2eb /fs/eventpoll.c | |
parent | b1c12cbcd0a02527c180a862e8971e249d3b347d (diff) |
epoll: clear the tfile_check_list on -ELOOP
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>
Diffstat (limited to 'fs/eventpoll.c')
-rw-r--r-- | fs/eventpoll.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 739b0985b398..c0b3c70ee87a 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -1663,8 +1663,10 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, | |||
1663 | if (op == EPOLL_CTL_ADD) { | 1663 | if (op == EPOLL_CTL_ADD) { |
1664 | if (is_file_epoll(tfile)) { | 1664 | if (is_file_epoll(tfile)) { |
1665 | error = -ELOOP; | 1665 | error = -ELOOP; |
1666 | if (ep_loop_check(ep, tfile) != 0) | 1666 | if (ep_loop_check(ep, tfile) != 0) { |
1667 | clear_tfile_check_list(); | ||
1667 | goto error_tgt_fput; | 1668 | goto error_tgt_fput; |
1669 | } | ||
1668 | } else | 1670 | } else |
1669 | list_add(&tfile->f_tfile_llink, &tfile_check_list); | 1671 | list_add(&tfile->f_tfile_llink, &tfile_check_list); |
1670 | } | 1672 | } |