From: "driz2t@qq.com" <driz2t@qq.com>
To: "stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: "hch@infradead.org" <hch@infradead.org>,
"djwong@kernel.org" <djwong@kernel.org>,
"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
"leah.rumancik@gmail.com" <leah.rumancik@gmail.com>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"syzbot+c6104ecfe56e0fd6b616@syzkaller.appspotmail.com"
<syzbot+c6104ecfe56e0fd6b616@syzkaller.appspotmail.com>
Subject: [PATCH] iomap: don't invalidate folios after writeback errors
Date: Tue, 24 Mar 2026 13:45:51 +0000 [thread overview]
Message-ID: <tencent_EDC62D47C76FD4486F3B13D526674124CE07@qq.com> (raw)
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
reply other threads:[~2026-03-24 13:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_EDC62D47C76FD4486F3B13D526674124CE07@qq.com \
--to=driz2t@qq.com \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=leah.rumancik@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+c6104ecfe56e0fd6b616@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®