Re: [PATCH v6] pidfd: add ioctl to retrieve pid info

From: Luca Boccassi
Date: Mon Oct 07 2024 - 05:45:28 EST


On Mon, 7 Oct 2024 at 06:51, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> On 10/06, luca.boccassi@xxxxxxxxx wrote:
> >
> > +#ifdef CONFIG_CGROUPS
> > + if (request_mask & PIDFD_INFO_CGROUPID) {
> > + rcu_read_lock();
> > + struct cgroup *cgrp = task_cgroup(task, pids_cgrp_id);
> > + if (!cgrp)
> > + return -ENODEV;
>
> return without rcu_read_unlock().
>
> And iirc this is against the coding style, "struct cgroup *cgrp" should
> be declared at the start of block.
>
> Oleg.

Whops, thanks, fixed in v7