Commit f337b9c5 authored by Davide Libenzi's avatar Davide Libenzi Committed by Linus Torvalds

epoll: drop unnecessary test

Thomas found that there is an unnecessary (always true) test in
ep_send_events().  The callback never inserts into ->rdllink while the
send loop is performed, and also does the ~EP_PRIVATE_BITS test.  Given
we're holding the mutex during this time, the conditions tested inside the
loop are always true.  This patch drops the test done inside the
re-insertion loop.
Signed-off-by: default avatarDavide Libenzi <davidel@xmailserver.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8b6e47ad
...@@ -927,14 +927,11 @@ static int ep_send_events(struct eventpoll *ep, struct epoll_event __user *event ...@@ -927,14 +927,11 @@ static int ep_send_events(struct eventpoll *ep, struct epoll_event __user *event
/* /*
* During the time we spent in the loop above, some other events * During the time we spent in the loop above, some other events
* might have been queued by the poll callback. We re-insert them * might have been queued by the poll callback. We re-insert them
* here (in case they are not already queued, or they're one-shot). * inside the main ready-list here.
*/ */
for (nepi = ep->ovflist; (epi = nepi) != NULL; for (nepi = ep->ovflist; (epi = nepi) != NULL;
nepi = epi->next, epi->next = EP_UNACTIVE_PTR) { nepi = epi->next, epi->next = EP_UNACTIVE_PTR)
if (!ep_is_linked(&epi->rdllink) &&
(epi->event.events & ~EP_PRIVATE_BITS))
list_add_tail(&epi->rdllink, &ep->rdllist); list_add_tail(&epi->rdllink, &ep->rdllist);
}
/* /*
* We need to set back ep->ovflist to EP_UNACTIVE_PTR, so that after * We need to set back ep->ovflist to EP_UNACTIVE_PTR, so that after
* releasing the lock, events will be queued in the normal way inside * releasing the lock, events will be queued in the normal way inside
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment