[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190729142744.GA11349@redhat.com>
Date: Mon, 29 Jul 2019 16:27:44 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Christian Brauner <christian@...uner.io>
Cc: linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
arnd@...db.de, ebiederm@...ssion.com, keescook@...omium.org,
joel@...lfernandes.org, tglx@...utronix.de, tj@...nel.org,
dhowells@...hat.com, jannh@...gle.com, luto@...nel.org,
akpm@...ux-foundation.org, cyphar@...har.com,
viro@...iv.linux.org.uk, kernel-team@...roid.com
Subject: Re: [PATCH v3 1/2] pidfd: add P_PIDFD to waitid()
On 07/28, Christian Brauner wrote:
>
> +static struct pid *pidfd_get_pid(unsigned int fd)
> +{
> + struct fd f;
> + struct pid *pid;
> +
> + f = fdget(fd);
> + if (!f.file)
> + return ERR_PTR(-EBADF);
> +
> + pid = pidfd_pid(f.file);
> + if (!IS_ERR(pid))
> + get_pid(pid);
> +
> + fdput(f);
> + return pid;
> +}
Agreed, this looks better than the previous version.
FWIW,
Reviewed-by: Oleg Nesterov <oleg@...hat.com>
Powered by blists - more mailing lists