bcachefs: Fix btree key cache shutdown
On emergency shutdown, we might still have dirty keys in the btree key cache that need to be cleaned up properly. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
committed by
Kent Overstreet
parent
6a747c4683
commit
f526d26d71
@@ -490,6 +490,9 @@ void bch2_fs_btree_key_cache_exit(struct btree_key_cache *bc)
|
|||||||
list_splice(&bc->dirty, &bc->clean);
|
list_splice(&bc->dirty, &bc->clean);
|
||||||
|
|
||||||
list_for_each_entry_safe(ck, n, &bc->clean, list) {
|
list_for_each_entry_safe(ck, n, &bc->clean, list) {
|
||||||
|
bch2_journal_pin_drop(&c->journal, &ck->journal);
|
||||||
|
bch2_journal_preres_put(&c->journal, &ck->res);
|
||||||
|
|
||||||
kfree(ck->k);
|
kfree(ck->k);
|
||||||
kfree(ck);
|
kfree(ck);
|
||||||
bc->nr_keys--;
|
bc->nr_keys--;
|
||||||
|
@@ -263,6 +263,7 @@ static void bch2_journal_reclaim_fast(struct journal *j)
|
|||||||
while (!fifo_empty(&j->pin) &&
|
while (!fifo_empty(&j->pin) &&
|
||||||
!atomic_read(&fifo_peek_front(&j->pin).count)) {
|
!atomic_read(&fifo_peek_front(&j->pin).count)) {
|
||||||
BUG_ON(!list_empty(&fifo_peek_front(&j->pin).list));
|
BUG_ON(!list_empty(&fifo_peek_front(&j->pin).list));
|
||||||
|
BUG_ON(!list_empty(&fifo_peek_front(&j->pin).flushed));
|
||||||
BUG_ON(!fifo_pop(&j->pin, temp));
|
BUG_ON(!fifo_pop(&j->pin, temp));
|
||||||
popped = true;
|
popped = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user