Re: [RFC PATCH 27/27] epoll: take epitem list out of struct file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
>  	}
>  




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux