mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iomap: don't invalidate folios after writeback errors
@ 2026-03-24 13:45 driz2t
  0 siblings, 0 replies; only message in thread
From: driz2t @ 2026-03-24 13:45 UTC (permalink / raw)
  To: stable
  Cc: hch, djwong, linux-xfs, leah.rumancik, linux-fsdevel,
	linux-kernel, syzbot+c6104ecfe56e0fd6b616

This patch is a backport to stable 5.15.y of upstream commit e9c3a8e820ed0eeb2be05072f29f80d1b79f053b
("iomap: don't invalidate folios after writeback errors").

Fixes: 3330a8d33e08 ("iomap, xfs: fix page discard handling on shutdown")
Reported-by: syzbot+c0ffed3897231d71f047@syzkaller.appspotmail.com
Tested-by: syzbot+c0ffed3897231d71f047@syzkaller.appspotmail.com
Signed-off-by: Changjian Liu <driz2t@qq.com>
---
 fs/iomap/buffered-io.c | 1 -
 fs/xfs/xfs_aops.c      | 4 +---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 87a4f5a2ded0..1f0bfe0b8bae 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -1350,7 +1350,6 @@ iomap_writepage_map(struct iomap_writepage_ctx *wpc,
 		if (wpc->ops->discard_page)
 			wpc->ops->discard_page(page, file_offset);
 		if (!count) {
-			ClearPageUptodate(page);
 			unlock_page(page);
 			goto done;
 		}
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index c8c15c3c3147..56a5bd7ad8c4 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -450,7 +450,7 @@ xfs_discard_page(
 	int			error;
 
 	if (xfs_is_shutdown(mp))
-		goto out_invalidate;
+		return;
 
 	xfs_alert_ratelimited(mp,
 		"page discard on page "PTR_FMT", inode 0x%llx, offset %llu.",
@@ -460,8 +460,6 @@ xfs_discard_page(
 			i_blocks_per_page(inode, page) - pageoff_fsb);
 	if (error && !xfs_is_shutdown(mp))
 		xfs_alert(mp, "page discard unable to remove delalloc mapping.");
-out_invalidate:
-	iomap_invalidatepage(page, pageoff, PAGE_SIZE - pageoff);
 }
 
 static const struct iomap_writeback_ops xfs_writeback_ops = {
-- 
2.43.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-03-24 13:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-24 13:45 [PATCH] iomap: don't invalidate folios after writeback errors driz2t

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®