summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChao Shi <coshi036@gmail.com>2026-08-06 12:58:34 -0400
committerChristian Brauner <brauner@kernel.org>2026-09-10 09:27:25 +0200
commit0015b215eb6270d3e6bb5437b5198f5c38f4d2cd (patch)
treeb4aeae17dd098b80e4a4af01c4e6c69541058ed6
parent5089db0f2dd38a64921eb44e55eb78dfd0b242fc (diff)
downloadlinux-next-0015b215eb6270d3e6bb5437b5198f5c38f4d2cd.tar.gz
linux-next-0015b215eb6270d3e6bb5437b5198f5c38f4d2cd.zip
exfat: check for a directory write error with buffer_write_io_error()
exfat_update_bhs() waits for the writes it issued and then tests !buffer_uptodate() to find the ones that failed. That relies on the write completion handler clearing BH_Uptodate on error, which this series removes: a buffer whose write failed still holds the data the filesystem asked to be written, so declaring it not up to date is wrong and makes callers re-read it. Test BH_Write_EIO, which is what the completion handler sets and what this code actually wants to know. No behaviour change today - a failed write sets BH_Write_EIO and clears BH_Uptodate together. It stops being a no-op at the end of the series, where the new test is the one that still works. Acked-by: Weidong Zhu <weizhu@fiu.edu> Signed-off-by: Chao Shi <coshi036@gmail.com> Link: https://patch.msgid.link/0784ef63a525434e7c0aff730eca7b43e043095d.1785951556.git.coshi036@gmail.com Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
-rw-r--r--fs/exfat/misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/exfat/misc.c b/fs/exfat/misc.c
index 6f11a96a4ffa..dfd0bbf31c94 100644
--- a/fs/exfat/misc.c
+++ b/fs/exfat/misc.c
@@ -187,7 +187,7 @@ int exfat_update_bhs(struct buffer_head **bhs, int nr_bhs, int sync)
for (i = 0; i < nr_bhs && sync; i++) {
wait_on_buffer(bhs[i]);
- if (!err && !buffer_uptodate(bhs[i]))
+ if (!err && buffer_write_io_error(bhs[i]))
err = -EIO;
}
return err;