[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201005204941.GT3421308@ZenIV.linux.org.uk>
Date: Mon, 5 Oct 2020 21:49:41 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Qian Cai <cai@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Marc Zyngier <maz@...nel.org>
Subject: Re: [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;
> > }
> >
>
Powered by blists - more mailing lists