Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1599681

Re: [patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files

From Cyrill Gorcunov <gorcunov@gmail.com>
Newsgroups linux.kernel
Subject Re: [patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files
Date 2017-03-13 19:40 +0100
Message-ID <tkD2V-4vZ-15@gated-at.bofh.it> (permalink)
References <tjo5X-1aS-1@gated-at.bofh.it> <tkD2V-4vZ-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Mar 13, 2017 at 10:37:24AM -0700, Andrei Vagin wrote:
> 
> Here is one question inline.
> 
> Acked-by: Andrei Vagin <avagin@virtuozzo.com>

Thanks!

> > +
> > +	files = get_files_struct(task2);
> > +	if (!files)
> > +		return -EBADF;
> > +
> > +	spin_lock(&files->file_lock);
> > +	filp_epoll = fcheck_files(files, slot.efd);
> > +	if (filp_epoll)
> > +		get_file(filp_epoll);
> > +	else
> > +		filp_tgt = ERR_PTR(-EBADF);
> > +	spin_unlock(&files->file_lock);
> > +	put_files_struct(files);
> 
> Why can we not use fget here ^^^^ ?

Because it's not @current's file table but foreigner process.
So we make sure there is no expand_fdtable in progress and
we test for file descriptor which is being freed.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files Cyrill Gorcunov <gorcunov@openvz.org> - 2017-03-10 09:30 +0100
  Re: [patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll  target files Cyrill Gorcunov <gorcunov@gmail.com> - 2017-03-13 15:10 +0100
  Re: [patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll  target files Cyrill Gorcunov <gorcunov@gmail.com> - 2017-03-13 19:40 +0100

csiph-web