in the "non-epoll target" cases do it in ep_insert() rather than
in do_epoll_ctl(), so that we do it only with some epitem is already
guaranteed to exist.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
spin_lock(&tfile->f_lock);
hlist_add_head_rcu(&epi->fllink, &tfile->f_ep_links);
spin_unlock(&tfile->f_lock);
+ if (full_check && !tep) {
+ get_file(tfile);
+ list_add(&tfile->f_tfile_llink, &tfile_check_list);
+ }
/*
* Add the current item to the RB tree. All RB tree operations are
error = -ELOOP;
if (ep_loop_check(ep, tep) != 0)
goto error_tgt_fput;
- } else {
- get_file(tf.file);
- list_add(&tf.file->f_tfile_llink,
- &tfile_check_list);
}
error = epoll_mutex_lock(&ep->mtx, 0, nonblock);
if (error)