Skip to content
Commit 54541c1f authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Fix race in bch2_write_super()



bch2_write_super() was looping over online devices multiple times -
dropping and retaking io_ref each time.

This meant it could race with device removal; it could increment the
sequence number on a device but fail to write it - and then if the
device was re-added, it would get confused the next time around thinking
a superblock write was silently dropped.

Fix this by taking io_ref once, and stashing pointers to online devices
in a darray.

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 71dac248
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment