• Andrew Morton's avatar
    [PATCH] epoll cross-thread deletion fix · 92a88ec9
    Andrew Morton authored
    From: Davide Libenzi <davidel@xmailserver.org>
    
    
    This fixes a bug that might happen having a thread doing epoll_wait() with
    another thread doing epoll_ctl(EPOLL_CTL_DEL) and close(). The fast check
    inside eventpoll_release() is good to not effect performace of code not
    using epoll, but it requires get_file() to be called ( that can be avoided
    by dropping the fast check ). I opted to keep the fast check and to have
    epoll to call get_file() before the event send loop. I tested it on UP and
    2SMP with a bug-exploiting program provided by @pivia.com ( thx to them )
    and it looks fine. I also update the 2.4.20 epoll patch with this fix :
    92a88ec9
eventpoll.c 45.2 KB