--- x/fs/eventpoll.c +++ y/fs/eventpoll.c @@ -991,9 +991,13 @@ static __poll_t ep_item_poll(const struc __poll_t res; pt->_key = epi->event.events; - if (!is_file_epoll(file)) - res = vfs_poll(file, pt); - else + if (!is_file_epoll(file)) { + res = 0; + if (atomic_long_inc_not_zero(&file->f_count)) { + res = vfs_poll(file, pt); + fput(file); + } + } else res = __ep_eventpoll_poll(file, pt, depth); return res & epi->event.events; }