Re: [PATCH] exit: skip IRQ disabled warning during power off
From: Oleg Nesterov
Date: Fri Apr 04 2025 - 11:25:32 EST
On 04/04, Mateusz Guzik wrote:
>
> Preferably this would be fixed so that nobody calls here with irqs off.
This is not my area, I can't help, but do you understand why sys_reboot()
needs to call do_exit() ?
Say, why the stupid patch below is wrong?
Oleg.
diff --git a/kernel/reboot.c b/kernel/reboot.c
index ec087827c85c..0d0c8aa3ffcd 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -777,12 +777,11 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
case LINUX_REBOOT_CMD_HALT:
kernel_halt();
- do_exit(0);
+ for (;;) cpu_relax();
case LINUX_REBOOT_CMD_POWER_OFF:
kernel_power_off();
- do_exit(0);
- break;
+ for (;;) cpu_relax();
case LINUX_REBOOT_CMD_RESTART2:
ret = strncpy_from_user(&buffer[0], arg, sizeof(buffer) - 1);