Re: [v5 PATCH 2/2] hung_task: Enable runtime reset of hung_task_detect_count
From: Aaron Tomlin
Date: Tue Jan 06 2026 - 22:37:58 EST
On Tue, Jan 06, 2026 at 12:51:14PM +0100, Joel Granados wrote:
> Could you do something like this (untested):
>
> if (SYSCTL_KERN_TO_USER(dir))
> detect_count = atomic_long_read(&sysctl_hung_task_detect_count);
>
> err = proc_doulongvec_minmax(&proxy_table, dir, buffer, lenp, ppos);
> if (err < 0)
> return err;
>
> if (SYSCTL_USER_TO_KERN(dir)) {
> if (detect_count)
> return -EINVAL;
>
> atomic_long_set(&sysctl_hung_task_detect_count, 0);
> }
>
> return 0;
Fair enough. If the input is malformed or out of bounds, it exits early
with an error.
> why do you advance ppos here? It is already advanced when you call
> proc_doulongvec_minmax.
Acknowledged.
Kind regards,
--
Aaron Tomlin
Attachment:
signature.asc
Description: PGP signature