diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-08-30 11:40:03 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:39 -0400 |
commit | c919f53f3bcba3598fc6ce1ee5c5aed75d0834b7 (patch) | |
tree | 79baeaf0c2c915fafbe356bf3efa45351f9a4a88 /fs/bcachefs/btree_key_cache.c | |
parent | f5178b34b9f1b53d2a97a2a210d3c284966428e4 (diff) | |
download | lwn-c919f53f3bcba3598fc6ce1ee5c5aed75d0834b7.tar.gz lwn-c919f53f3bcba3598fc6ce1ee5c5aed75d0834b7.zip |
bcachefs: Don't leak lock pcpu counts memory
This fixes a small memory leak.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_key_cache.c')
-rw-r--r-- | fs/bcachefs/btree_key_cache.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/bcachefs/btree_key_cache.c b/fs/bcachefs/btree_key_cache.c index 127cb6edaff5..7349c70f8445 100644 --- a/fs/bcachefs/btree_key_cache.c +++ b/fs/bcachefs/btree_key_cache.c @@ -238,8 +238,6 @@ btree_key_cache_create(struct bch_fs *c, } else { if (btree_id == BTREE_ID_subvolumes) six_lock_pcpu_alloc(&ck->c.lock); - else - six_lock_pcpu_free(&ck->c.lock); } ck->c.level = 0; @@ -688,6 +686,7 @@ static unsigned long bch2_btree_key_cache_scan(struct shrinker *shrink, break; list_del(&ck->list); + six_lock_pcpu_free(&ck->c.lock); kmem_cache_free(bch2_key_cache, ck); atomic_long_dec(&bc->nr_freed); scanned++; |