Re: [PATCH] sysfs/cpu: Make crash_hotplug attribute world-readable

From: Baoquan He
Date: Thu Jul 11 2024 - 23:36:01 EST


On 07/11/24 at 12:34pm, Petr Tesarik wrote:
> From: Petr Tesarik <ptesarik@xxxxxxxx>
>
> There is no reason to restrict access to this attribute, as it merely
> reports whether crash elfcorehdr is automatically updated on CPU hot
> plug/unplug and/or online/offline events.
>
> Note that since commit 79365026f8694 ("crash: add a new kexec flag for
> hotplug support"), this maps to the same flag which is world-accessible
> through /sys/devices/system/memory/crash_hotplug.
>
> Signed-off-by: Petr Tesarik <ptesarik@xxxxxxxx>
> ---
> drivers/base/cpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> index c61ecb0c2ae2..73d69791d0d3 100644
> --- a/drivers/base/cpu.c
> +++ b/drivers/base/cpu.c
> @@ -308,7 +308,7 @@ static ssize_t crash_hotplug_show(struct device *dev,
> {
> return sysfs_emit(buf, "%d\n", crash_check_hotplug_support());
> }
> -static DEVICE_ATTR_ADMIN_RO(crash_hotplug);
> +static DEVICE_ATTR_RO(crash_hotplug);

Agree. I guess this was copied from codes related to
crash_notes/crash_notes_size. While crash_notes/crash_notes_size are in
/sys/devices/system/cpu/cpuX/ which is next level.

Acked-by: Baoquan He <bhe@xxxxxxxxxx>