lkml.org 
[lkml]   [2020]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 27/27] epoll: take epitem list out of struct file
On Mon, Oct 05, 2020 at 04:37:18PM -0400, Qian Cai wrote:
> On Sun, 2020-10-04 at 03:39 +0100, Al Viro wrote:
> > /*
> > * Must be called with "mtx" held.
> > */
> > @@ -1367,19 +1454,21 @@ static int ep_insert(struct eventpoll *ep, const
> > struct epoll_event *event,
> > epi->event = *event;
> > epi->next = EP_UNACTIVE_PTR;
> >
> > - atomic_long_inc(&ep->user->epoll_watches);
> > -
> > if (tep)
> > mutex_lock(&tep->mtx);
> > /* Add the current item to the list of active epoll hook for this file
> > */
> > - 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);
> > + if (unlikely(attach_epitem(tfile, epi) < 0)) {
> > + kmem_cache_free(epi_cache, epi);
> > + if (tep)
> > + mutex_lock(&tep->mtx);
>
> Shouldn't this be mutex_unlock() instead?

It should. Fixed and force-pushed...

> > + return -ENOMEM;
> > }
> >
>

\
 
 \ /
  Last update: 2020-10-05 22:51    [W:0.073 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site