[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b56d7eff12d3e85f4fcca11d70b8dbb29da25a3f.camel@redhat.com>
Date: Mon, 05 Oct 2020 16:37:18 -0400
From: Qian Cai <cai@...hat.com>
To: Al Viro <viro@...IV.linux.org.uk>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: 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 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?
> + return -ENOMEM;
> }
>
Powered by blists - more mailing lists