summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChao Shi <coshi036@gmail.com>2026-08-06 12:58:29 -0400
committerChristian Brauner <brauner@kernel.org>2026-09-10 09:27:24 +0200
commit7d439c46c9230b9ef9da8d164dcd8795b528e631 (patch)
tree923b5ee622fb6dec4c0037df48c475e22d5084eb
parentd9a8f9ffce29dc8409c885996dc210a8f394e478 (diff)
downloadlinux-next-7d439c46c9230b9ef9da8d164dcd8795b528e631.tar.gz
linux-next-7d439c46c9230b9ef9da8d164dcd8795b528e631.zip
buffer: discard BH_Write_EIO along with the rest of the buffer state
discard_buffer() strips the state that describes where a buffer lives and what has happened to it, because after an invalidate none of it applies any more. BH_Write_EIO belongs in that set for the same reason: it describes a write of the data that is being thrown away. Leaving it set means a buffer_head reused for a different block starts life carrying somebody else's write error. Like the bforget() change, this is mostly theoretical today and becomes load bearing once the rest of the series makes BH_Write_EIO the report of a failed metadata write. Suggested-by: Jan Kara <jack@suse.cz> Acked-by: Weidong Zhu <weizhu@fiu.edu> Signed-off-by: Chao Shi <coshi036@gmail.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/c6e9db48d8d0feb83d4ca29306f4bc1e58f1ee0f.1785951556.git.coshi036@gmail.com Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
-rw-r--r--fs/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index f3bf87ccb536..9ff946a2487a 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1493,7 +1493,7 @@ EXPORT_SYMBOL(folio_set_bh);
/* Bits that are cleared during an invalidate */
#define BUFFER_FLAGS_DISCARD \
(1 << BH_Mapped | 1 << BH_New | 1 << BH_Req | \
- 1 << BH_Delay | 1 << BH_Unwritten)
+ 1 << BH_Delay | 1 << BH_Unwritten | 1 << BH_Write_EIO)
static void discard_buffer(struct buffer_head * bh)
{