diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-02-27 09:56:33 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:26 -0400 |
commit | bf3efff5e4fc2dcd6e6c15578d3f08c301a13229 (patch) | |
tree | cca40f2591a81ba52e14350a663266b83c78e43f /fs/bcachefs/bkey_buf.h | |
parent | 6f5f747c318be4adf3824ee7716a7886da35f9a3 (diff) |
bcachefs: Fix race leading to btree node write getting stuck
Checking btree_node_may_write() isn't atomic with the other btree flags,
dirty and need_write in particular. There was a rare race where we'd
unblock a node from writing while __btree_node_flush() was setting
need_write, and no thread would notice that the node was now both able
to write and needed to be written.
Fix this by adding btree node flags for will_make_reachable and
write_blocked that can be checked in the cmpxchg loop in
__bch2_btree_node_write.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/bkey_buf.h')
0 files changed, 0 insertions, 0 deletions