All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: do not report interrupted truncate as filesystem error
@ 2026-11-29  4:37 ` Christopher Lusk via B4 Relay
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Lusk @ 2026-11-29  4:37 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: Andreas Dilger, Baokun Li, Jan Kara, Ojaswin Mujoo,
	Ritesh Harjani (IBM), Zhang Yi, linux-ext4, Christopher Lusk

A fatal signal can interrupt the buffered iomap truncate-up path with
-EINTR. ext4_setattr() then routes that transient error through
ext4_std_error(), which sets the filesystem error flag and can remount
a healthy filesystem read-only with errors=remount-ro.

Ignore the interrupted error only while a fatal signal is pending, so
real -EINTR errors are still reported.

Found by LLM-driven ext4 concurrency testing.

Fixes: 68738d77ce86 ("ext4: implement partial block zero range path using iomap")
Signed-off-by: Christopher Lusk <clusk@northecho.dev>
---
Tested in a 2-CPU network-less KVM lab on v7.4-rc4, both KASAN and
non-KASAN. The stock kernel reproduced ext4_setattr:7161 with error 4
and an emergency read-only remount in 3/3 runs; the patched kernel was
clean in 3/3 runs. e2fsck was not rerun after the fixed validation, and
no other buffered_iomap configurations were tested.

Drafted with LLM assistance; I reviewed, tested and edited it.
---
 fs/ext4/super.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 880f664d6c04..112dfae7a738 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -43,6 +43,7 @@
 #include <linux/iversion.h>
 #include <linux/unicode.h>
 #include <linux/part_stat.h>
+#include <linux/sched/signal.h>
 #include <linux/kthread.h>
 #include <linux/freezer.h>
 #include <linux/fsnotify.h>
@@ -1022,6 +1023,9 @@ void __ext4_std_error(struct super_block *sb, const char *function,
 	if (errno == -EROFS && journal_current_handle() == NULL && sb_rdonly(sb))
 		return;
 
+	if (errno == -EINTR && fatal_signal_pending(current))
+		return;
+
 	if (ext4_error_ratelimit(sb)) {
 		errstr = ext4_decode_error(sb, errno, nbuf);
 		printk(KERN_CRIT "EXT4-fs error (device %s) in %s:%d: %s\n",

---
base-commit: aceadbccd428fb8e6593b27a3091d961f80225d1
change-id: 20261128-b4-ext4-eintr-d876d9f48256

Best regards,
-- 
Christopher Lusk <clusk@northecho.dev>


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-29 14:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29  4:37 [PATCH] ext4: do not report interrupted truncate as filesystem error Christopher Lusk
2026-11-29  4:37 ` Christopher Lusk via B4 Relay
2026-11-29  4:54 ` sashiko-bot
2026-11-29 13:48   ` Christopher Lusk
2026-11-29 14:37     ` Christopher Lusk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.