[PATCH RESEND 1/9] f2fs: compress: avoid sleeping in atomic context in f2fs_decompress_cluster()
From: Jan Prusakowski
Date: Thu Nov 12 2026 - 10:20:18 EST
f2fs_decompress_cluster() can be invoked directly from bio completion
(softirq/IRQ context) when in_task is false. Passing GFP_NOFS to
fserror_report_file_metadata() in that context can sleep and trigger a
scheduling-while-atomic bug.
Use GFP_NOWAIT when !in_task, matching f2fs_sanity_check_node_footer().
Fixes: ccc6436abb84 ("f2fs: support to report fserror")
Assisted-by: LLM
Signed-off-by: Jan Prusakowski <jprusakowski@xxxxxxxxxx>
---
fs/f2fs/compress.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index c7910688c318..9453254ff522 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -763,7 +763,8 @@ void f2fs_decompress_cluster(struct decompress_io_ctx *dic, bool in_task)
/* Avoid f2fs_commit_super in irq context */
f2fs_handle_error(sbi, ERROR_FAIL_DECOMPRESSION);
- fserror_report_file_metadata(dic->inode, ret, GFP_NOFS);
+ fserror_report_file_metadata(dic->inode, ret,
+ in_task ? GFP_NOFS : GFP_NOWAIT);
goto out_release;
}
--
2.56.0.567.gdb80ae8cd5-goog