Skip to contentSkip to conversation

iomap: don't invalidate folios after writeback errors

PATCH New [email protected] 1 participant 1 message Mar 24

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iomap: don't invalidate folios after writeback errors

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 [email protected]
---
 fs/iomap/buffered-io.c | 1 -
 fs/xfs/xfs_aops.c      | 4 +---
 2 files changed, 1 insertion(+), 4 deletions(-)
fs/iomap/buffered-io.c +0 -1
index 87a4f5a2ded0..1f0bfe0b8bae 100644
@@ -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;
 		}
fs/xfs/xfs_aops.c +1 -3
index c8c15c3c3147..56a5bd7ad8c4 100644
@@ -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 = {
Signature · 1 line
2.43.0