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

From: Oleg Nesterov
Date: Mon Oct 07 2024 - 01:52:09 EST


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.