Commit c919f53f authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Don't leak lock pcpu counts memory

This fixes a small memory leak.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent f5178b34
...@@ -238,8 +238,6 @@ btree_key_cache_create(struct bch_fs *c, ...@@ -238,8 +238,6 @@ btree_key_cache_create(struct bch_fs *c,
} else { } else {
if (btree_id == BTREE_ID_subvolumes) if (btree_id == BTREE_ID_subvolumes)
six_lock_pcpu_alloc(&ck->c.lock); six_lock_pcpu_alloc(&ck->c.lock);
else
six_lock_pcpu_free(&ck->c.lock);
} }
ck->c.level = 0; ck->c.level = 0;
...@@ -688,6 +686,7 @@ static unsigned long bch2_btree_key_cache_scan(struct shrinker *shrink, ...@@ -688,6 +686,7 @@ static unsigned long bch2_btree_key_cache_scan(struct shrinker *shrink,
break; break;
list_del(&ck->list); list_del(&ck->list);
six_lock_pcpu_free(&ck->c.lock);
kmem_cache_free(bch2_key_cache, ck); kmem_cache_free(bch2_key_cache, ck);
atomic_long_dec(&bc->nr_freed); atomic_long_dec(&bc->nr_freed);
scanned++; scanned++;
......
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