diff options
author | Brian Foster <bfoster@redhat.com> | 2023-12-05 08:24:39 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 11:47:40 -0500 |
commit | 5a11b5fe79e9f781db8aec6222d03dc92e2978d9 (patch) | |
tree | a0dced6583443e247d090dbe61dd25d414fd6800 /fs/bcachefs/super.c | |
parent | 56ec287d30ba2f8dec70b642e9b2c108116cbfd9 (diff) | |
download | lwn-5a11b5fe79e9f781db8aec6222d03dc92e2978d9.tar.gz lwn-5a11b5fe79e9f781db8aec6222d03dc92e2978d9.zip |
bcachefs: return from fsync on writeback error to avoid early shutdown
When investigating transient failures of generic/441 on bcachefs, it
was determined that the cause of the failure was a combination of
unconditional emergency shutdown and racing between background
journal activity and the test switchover from a working device
mapper table to an error injecting table.
Part of the reason for this sequence of events is that bcachefs
aggressively flushes as much as possible during fsync(), regardless
of errors. While this is reasonable behavior, it is technically
unnecessary because once an error is returned from fsync(), the
caller cannot make any assumptions about the resilience of data.
Tweak the bch2_fsync() logic to return an error on failure of any of
the steps involved in the flush. Note that this change alone does
not prevent generic/441 failure, but in combination with a test
tweak to avoid racing during the dm-error table switchover it avoids
the unnecessary shutdowns and allows the test to pass reliably on
bcachefs.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.c')
0 files changed, 0 insertions, 0 deletions