linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Andrei Vagin <avagin@virtuozzo.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org, viro@zeniv.linux.org.uk,
	akpm@linuxfoundation.org, xemul@virtuozzo.com,
	mtk.manpages@gmail.com, kir@openvz.org,
	Andrey Vagin <avagin@openvz.org>, Jason Baron <jbaron@akamai.com>,
	Andy Lutomirski <luto@amacapital.net>
Subject: Re: [patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files
Date: Mon, 13 Mar 2017 21:37:58 +0300	[thread overview]
Message-ID: <20170313183758.GE6743@uranus.lan> (raw)
In-Reply-To: <20170313173723.GA2855@outlook.office365.com>

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.

      reply	other threads:[~2017-03-13 18:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10  8:16 [patch 2/3] kcmp: Add KCMP_EPOLL_TFD mode to compare epoll target files Cyrill Gorcunov
2017-03-13 14:04 ` Cyrill Gorcunov
2017-03-13 17:37 ` Andrei Vagin
2017-03-13 18:37   ` Cyrill Gorcunov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170313183758.GE6743@uranus.lan \
    --to=gorcunov@gmail.com \
    --cc=akpm@linuxfoundation.org \
    --cc=avagin@openvz.org \
    --cc=avagin@virtuozzo.com \
    --cc=jbaron@akamai.com \
    --cc=kir@openvz.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mtk.manpages@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xemul@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).