On Mon, Apr 17, 2023 at 04:06:53PM -0700, Bart Van Assche wrote: > System shutdown happens as follows (see e.g. the systemd source file > src/shutdown/shutdown.c): > * sync() is called. > * reboot(RB_AUTOBOOT/RB_HALT_SYSTEM/RB_POWER_OFF) is called. > * If the reboot() system call returns, log an error message. > > The reboot() system call causes the kernel to call kernel_restart(), > kernel_halt() or kernel_power_off(). Each of these functions calls > device_shutdown(). device_shutdown() calls sd_shutdown(). After > sd_shutdown() has been called the .shutdown() callback of the LLD > will be called. Hence, I/O submitted after sd_shutdown() will hang or > may even cause a kernel crash. > > Let sd_shutdown() fail future I/O such that LLD .shutdown() callbacks > can be simplified. Hi Bart, Last time you mentioned the current way may have kernel panic risk, but you never explain the panic, can you document the panic in commit log? Thanks, Ming