From: Jason Baron Date: Wed, 25 Apr 2012 23:01:47 +0000 (-0700) Subject: epoll: clear the tfile_check_list on -ELOOP X-Git-Tag: v3.2.24~86 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=11a5b0b59b9b38e71fa45bd9739a6f4ffa8ce61a;p=karo-tx-linux.git 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 Reported-by: Yurij M. Plotnikov Cc: Nelson Elhage Cc: Davide Libenzi Tested-by: Alexandra N. Kossovsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Ben Hutchings --- diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 4d9d3a45e356..a6f376323c7c 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1629,8 +1629,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); }