Commit 053dbb37 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix a locking bug

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 66393392
...@@ -883,6 +883,7 @@ static int bch2_invalidate_buckets(struct bch_fs *c, struct bch_dev *ca) ...@@ -883,6 +883,7 @@ static int bch2_invalidate_buckets(struct bch_fs *c, struct bch_dev *ca)
ret = __bch2_alloc_write_key(c, ca, b, &iter, ret = __bch2_alloc_write_key(c, ca, b, &iter,
must_flush ? &journal_seq : NULL, must_flush ? &journal_seq : NULL,
BTREE_INSERT_GC_LOCK_HELD|
!fifo_empty(&ca->free_inc) ? BTREE_INSERT_NOWAIT : 0); !fifo_empty(&ca->free_inc) ? BTREE_INSERT_NOWAIT : 0);
} }
......
...@@ -624,6 +624,9 @@ int __bch2_btree_insert_at(struct btree_insert *trans) ...@@ -624,6 +624,9 @@ int __bch2_btree_insert_at(struct btree_insert *trans)
/* for the sake of sanity: */ /* for the sake of sanity: */
BUG_ON(trans->nr > 1 && !(trans->flags & BTREE_INSERT_ATOMIC)); BUG_ON(trans->nr > 1 && !(trans->flags & BTREE_INSERT_ATOMIC));
if (trans->flags & BTREE_INSERT_GC_LOCK_HELD)
lockdep_assert_held(&c->gc_lock);
bubble_sort(trans->entries, trans->nr, btree_trans_cmp); bubble_sort(trans->entries, trans->nr, btree_trans_cmp);
trans_for_each_entry(trans, i) trans_for_each_entry(trans, i)
......
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