diff options
| author | Chao Shi <coshi036@gmail.com> | 2026-08-06 12:58:39 -0400 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-09-10 09:27:26 +0200 |
| commit | 9ba9d0441569749391bea9938c91870cd1e68601 (patch) | |
| tree | 8067e628291d3fe991e5706100cd0658c7947671 /tools/lib/python | |
| parent | 8bf5c5a94a8707f879706fd42a8bf5604955d12c (diff) | |
| download | linux-next-9ba9d0441569749391bea9938c91870cd1e68601.tar.gz linux-next-9ba9d0441569749391bea9938c91870cd1e68601.zip | |
gfs2: check for a metadata write error with buffer_write_io_error()
gfs2_ail1_start_one() and gfs2_ail1_empty_one() decide whether a buffer on
the ail reached the disk by looking at BH_Uptodate once it is no longer
busy. 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 instead. In
gfs2_ail1_start_one() the test is the positive one, so the sense has to be
inverted rather than the flag simply swapped.
This is not a pure conversion for gfs2, because gfs2 already has a private
write completion handler that behaves the way this series is heading:
gfs2_end_log_write_bh() calls mark_buffer_write_io_error() and leaves
BH_Uptodate alone. Buffers completed through it are therefore invisible to
both tests today, and start being caught once they look at BH_Write_EIO.
That is a real behaviour change, and it is the one gfs2 wanted: a failed
log write now withdraws the filesystem instead of passing silently.
gfs2_pin() is a different case and gets a different treatment. Its
!buffer_uptodate() test is not only a proxy for a failed write - a buffer
with no valid contents at all is equally a reason to withdraw before
pinning it into a transaction - so the write error test is added to it
rather than replacing it.
Left alone deliberately: the BUG_ON(!buffer_uptodate(bh)) in gfs2_unpin()
and the two WARN_ON()s in fs/gfs2/rgrp.c. After this series they simply
stop firing for write errors, which is correct; turning them into
BUG_ON(buffer_write_io_error(bh)) would newly panic on an I/O error.
Acked-by: Weidong Zhu <weizhu@fiu.edu>
Signed-off-by: Chao Shi <coshi036@gmail.com>
Link: https://patch.msgid.link/a09b6d08d31d24f69b833e4d855ed88875e87780.1785951556.git.coshi036@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
