Re: [PATCH v3 2/3] s390: Implement arch_do_panic

[email protected]
Newsgroups org.kernel.vger.linux-s390
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The `pr_warn()` call in `on_panic_store()` is missing a terminating newline (`\n`), which will cause garbled console output.
- [Low] The file `arch/s390/kernel/ipl.c` does not include `<linux/panic.h>`, leading to a missing prototype compiler warning for `arch_do_panic()`.
--

--- Patch [2]: [PATCH v3 2/3] s390: Implement arch_do_panic ---
commit fa5fa116f1eec4d70650b8cf3a838d2dff72e007
Author: Mete Durlu <[email protected]>

s390: Implement arch_do_panic

This commit replaces the s390 custom panic notifier handler with the
arch_do_panic() hook. This reordering allows the user-specified
panic_timeout value to be evaluated correctly in common code. The timeout
now takes precedence over user-defined on_panic behavior.

> diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
> index 3c346b02ceb95..6a5fa9213450f 100644
> --- a/arch/s390/kernel/ipl.c
> +++ b/arch/s390/kernel/ipl.c
> @@ -2111,11 +2111,15 @@ static ssize_t on_panic_store(struct kobject *kobj,
>  			      struct kobj_attribute *attr,
>  			      const char *buf, size_t len)
>  {
> +	if (panic_timeout) {
> +		pr_warn("on_panic action will be ignored in favor of panic timeout (panic=%d)",
> +			panic_timeout);

[Severity: Medium]
Will this result in garbled console output since there is no terminating
newline in the format string? Because printk does not automatically append
a newline, the next message printed to the kernel log might be appended to
this same line.

> +	}
>  	return set_trigger(buf, &on_panic_trigger, len);
>  }
>  static struct kobj_attribute on_panic_attr = __ATTR_RW(on_panic);
>  
> -static void do_panic(void)
> +void arch_do_panic(void)

[Severity: Low]
Does this trigger a missing prototype compiler warning? The global function
arch_do_panic() is defined here to override the weak definition, but its
declaration is in linux/panic.h which does not seem to be included in this
file.

>  {
>  	lgr_info_log();
>  	on_panic_trigger.action->fn(&on_panic_trigger);

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.