This is an automated email from the ASF dual-hosted git repository. GUIDINGLI pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 1377e29be1d356e704b1d8be59760dde912593be Author: wangshaoxin <[email protected]> AuthorDate: Wed Nov 18 20:28:23 2026 +0800 fs: Do not sync in the reboot notifier from interrupt context Do not perform the sync operation during the interrupt to prevent the lower layer from holding the lock. Signed-off-by: wangshaoxin <[email protected]> Signed-off-by: jingfei <[email protected]> --- fs/fs_initialize.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/fs_initialize.c b/fs/fs_initialize.c index 3a808627a9f..a5ed0aff789 100644 --- a/fs/fs_initialize.c +++ b/fs/fs_initialize.c @@ -27,6 +27,7 @@ #include <nuttx/config.h> #include <nuttx/reboot_notifier.h> #include <nuttx/trace.h> +#include <nuttx/irq.h> #include "rpmsgfs/rpmsgfs.h" #include "inode/inode.h" @@ -46,7 +47,8 @@ static int sync_reboot_handler(FAR struct notifier_block *nb, unsigned long action, FAR void *data) { - if (action == SYS_POWER_OFF || action == SYS_RESTART) + if ((action == SYS_POWER_OFF || action == SYS_RESTART) && + !up_interrupt_context()) { sync(); }
