Commit b30b70ad authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Fix early error path in bch2_fs_btree_key_cache_exit()

parent a2ddaf96
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -956,6 +956,7 @@ void bch2_fs_btree_key_cache_exit(struct btree_key_cache *bc)
	}

#ifdef __KERNEL__
	if (bc->pcpu_freed) {
		for_each_possible_cpu(cpu) {
			struct btree_key_cache_freelist *f =
				per_cpu_ptr(bc->pcpu_freed, cpu);
@@ -965,6 +966,7 @@ void bch2_fs_btree_key_cache_exit(struct btree_key_cache *bc)
				list_add(&ck->list, &items);
			}
		}
	}
#endif

	BUG_ON(list_count_nodes(&bc->freed_pcpu) != bc->nr_freed_pcpu);