bcachefs: Fix freeing in bch2_dev_buckets_resize()
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 7 Feb 2022 00:20:36 +0000 (19:20 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:23 +0000 (17:09 -0400)
commit80bf2f345411b9952a984b6105cd860500b01228
tree3b9b10d874c65cbdd1326d30ac74136ecf77ae7f
parent35228ecb7e4d45822c0e2acbb0fb9555da31ef31
bcachefs: Fix freeing in bch2_dev_buckets_resize()

We were double-freeing old_buckets and not freeing old_buckets_gens:
also, the code was supposed to free buckets, not old_buckets;
old_buckets is only needed because we have to use rcu_assign_pointer()
instead of swap(), and won't be set if we hit the error path.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/bcachefs.h
fs/bcachefs/buckets.c