Commit 37bb9c95 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix locking in bch2_alloc_write_key()

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 264b501f
...@@ -1392,11 +1392,11 @@ static int bch2_alloc_write_key(struct btree_trans *trans, ...@@ -1392,11 +1392,11 @@ static int bch2_alloc_write_key(struct btree_trans *trans,
*old, *old,
b->data_type); b->data_type);
gc = *b; gc = *b;
percpu_up_read(&c->mark_lock);
if (gc.data_type != old_gc.data_type || if (gc.data_type != old_gc.data_type ||
gc.dirty_sectors != old_gc.dirty_sectors) gc.dirty_sectors != old_gc.dirty_sectors)
bch2_dev_usage_update_m(c, ca, &old_gc, &gc); bch2_dev_usage_update_m(c, ca, &old_gc, &gc);
percpu_up_read(&c->mark_lock);
if (metadata_only && if (metadata_only &&
gc.data_type != BCH_DATA_sb && gc.data_type != BCH_DATA_sb &&
......
Markdown is supported
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