From: Sasha Levin <sashal@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>,
Namjae Jeon <linkinjeon@kernel.org>,
Chi Zhiling <chizhiling@kylinos.cn>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH linux-next] exfat: check the emergency state in exfat_writeback_range()
Date: Thu, 19 Nov 2026 19:35:08 -0500 [thread overview]
Message-ID: <20261120003508.2135492-1-sashal@kernel.org> (raw)
In-Reply-To: <av2mOPyANz3H59F5@sirena.org.uk>
The vfs.all merge in next-20261119 takes the exfat side in
exfat_writepages(), where b900c61a3f21 ("exfat: drain dirty pages after
forced shutdown") moved the shutdown check into exfat_writeback_range(),
but leaves exfat_writeback_range() with exfat_forced_shutdown(). So the
exfat_emergency_state() check that 788f21d1f192 ("exfat: don't set
SB_RDONLY after filesystem errors") adds to writeback is lost, and after
an error with errors=remount-ro writeback keeps writing dirty data.
next-20261118 had exfat_emergency_state() in exfat_writeback_range().
Put it back.
Fixes: 026bdab726d8 ("Merge branch 'vfs.all' of https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git")
Link: https://lore.kernel.org/all/av2mOPyANz3H59F5@sirena.org.uk/
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
This is for folding into the vfs.all merge in fs-next. Built fs/exfat on
x86_64 (defconfig plus EXFAT_FS=m, W=1).
fs/exfat/iomap.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/exfat/iomap.c b/fs/exfat/iomap.c
index d0bcf523f48b5..a846fbc450b82 100644
--- a/fs/exfat/iomap.c
+++ b/fs/exfat/iomap.c
@@ -374,14 +374,14 @@ static ssize_t exfat_writeback_range(struct iomap_writepage_ctx *wpc,
struct folio *folio, u64 offset, unsigned int len, u64 end_pos)
{
struct inode *inode = wpc->inode;
+ int error;
- if (exfat_forced_shutdown(inode->i_sb))
- return -EIO;
+ error = exfat_emergency_state(inode->i_sb);
+ if (error)
+ return error;
if (offset < wpc->iomap.offset ||
offset >= wpc->iomap.offset + wpc->iomap.length) {
- int error;
-
error = __exfat_iomap_begin(inode, offset, len,
0, &wpc->iomap, false,
exfat_get_valid_size(EXFAT_I(inode)));
base-commit: adcad7f4e6332cff3d6d7165f41584899f598534
--
2.53.0
prev parent reply other threads:[~2026-11-20 0:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 13:20 linux-next: manual merge of the vfs-brauner tree with the exfat tree Mark Brown
2026-11-19 12:11 ` Christian Brauner
2026-11-20 0:35 ` Sasha Levin [this message]
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=20261120003508.2135492-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=brauner@kernel.org \
--cc=broonie@kernel.org \
--cc=chizhiling@kylinos.cn \
--cc=linkinjeon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
/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®