Skip to content
Commit 2111f394 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Fix race between btree writes and metadata drop



btree writes update the btree node key after every write, in order to
update sectors_written, and they also might need to drop pointers if one
of the writes failed in a replicated btree node.

But the btree node might also have had a pointer dropped while the write
was in flight, by bch2_dev_metadata_drop(), and thus there was a bug
where the btree node write would ovewrite the btree node's key with what
it had at the start of the write.

Fix this by dropping pointers not currently in the btree node key.

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent ef0beeb8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment