Am Di., 28. Okt. 2025 um 09:46 Uhr schrieb Christian Brauner
<brauner@kernel.org>:
>
> Use a guard().
>
> Signed-off-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
> ---
> fs/pidfs.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/pidfs.c b/fs/pidfs.c
> index 0ef5b47d796a..c2f0b7091cd7 100644
> --- a/fs/pidfs.c
> +++ b/fs/pidfs.c
> @@ -356,13 +356,12 @@ static long pidfd_info(struct file *file, unsigned int cmd, unsigned long arg)
> return -ESRCH;
>
> if ((kinfo.mask & PIDFD_INFO_COREDUMP) && !(kinfo.coredump_mask)) {
> - task_lock(task);
> + guard(task_lock)(task);
> if (task->mm) {
> unsigned long flags = __mm_flags_get_dumpable(task->mm);
>
> kinfo.coredump_mask = pidfs_coredump_mask(flags);
> }
> - task_unlock(task);
> }
>
> /* Unconditionally return identifiers and credentials, the rest only on request */
>
> --
> 2.47.3
>