summaryrefslogtreecommitdiff
path: root/fs/bcachefs/bcachefs.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-02-06 19:20:36 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:23 -0400
commit80bf2f345411b9952a984b6105cd860500b01228 (patch)
tree3b9b10d874c65cbdd1326d30ac74136ecf77ae7f /fs/bcachefs/bcachefs.h
parent35228ecb7e4d45822c0e2acbb0fb9555da31ef31 (diff)
downloadlwn-80bf2f345411b9952a984b6105cd860500b01228.tar.gz
lwn-80bf2f345411b9952a984b6105cd860500b01228.zip
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>
Diffstat (limited to 'fs/bcachefs/bcachefs.h')
-rw-r--r--fs/bcachefs/bcachefs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index 3d1a6773393c..59c0963f785f 100644
--- a/fs/bcachefs/bcachefs.h
+++ b/fs/bcachefs/bcachefs.h
@@ -451,7 +451,7 @@ struct bch_dev {
* Or rcu_read_lock(), but only for ptr_stale():
*/
struct bucket_array __rcu *buckets[2];
- struct bucket_gens *bucket_gens;
+ struct bucket_gens __rcu *bucket_gens;
unsigned long *buckets_nouse;
struct rw_semaphore bucket_lock;