[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240207102849.GA6627@redhat.com>
Date: Wed, 7 Feb 2024 11:28:50 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Christian Brauner <brauner@...nel.org>
Cc: Tycho Andersen <tycho@...ho.pizza>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
Tycho Andersen <tandersen@...flix.com>
Subject: Re: [PATCH] pidfd: getfd should always report ESRCH if a task is
exiting
On 02/07, Christian Brauner wrote:
>
> On Tue, Feb 06, 2024 at 08:25:54PM +0100, Oleg Nesterov wrote:
> > On 02/06, Tycho Andersen wrote:
> >
> > > On Tue, Feb 06, 2024 at 07:06:07PM +0100, Oleg Nesterov wrote:
> > > > Or we can check task->files != NULL rather than PF_EXITING.
> > > >
> > > > To me this looks even better, but looks more confusing without a comment.
> > > > OTOH, imo this needs a comment anyway ;)
> > >
> > > I thought about this, but I didn't really understand the null check in
> > > exit_files();
> >
> > I guess task->files can be NULL at least if it was cloned with
> > kernel_clone_args->no_files == T
>
> Won't this give false positives for vhost workers which do set
> ->no_files but are user workers? IOW, return -ESRCH even though -EBADF
> would be correct in this scenario?
OK, agreed. Lets check PF_EXITING or exit_state.
Oleg.
Powered by blists - more mailing lists