diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-07-23 05:28:40 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:08 -0400 |
commit | 3142e7ef4b39f03c1e1aac90c2ac8f07f55ffa64 (patch) | |
tree | 0b1e73bae214998f37bc5d2de74bd6cd325ed66f | |
parent | b29e197aafd95fc5cd50f0fd85c6275e3aa319a6 (diff) | |
download | lwn-3142e7ef4b39f03c1e1aac90c2ac8f07f55ffa64.tar.gz lwn-3142e7ef4b39f03c1e1aac90c2ac8f07f55ffa64.zip |
bcachefs: fix nbuckets usage on device resize
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/buckets.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 6a7e8b7b6a79..65232f5e61bc 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -818,9 +818,9 @@ int bch2_dev_buckets_resize(struct bch_fs *c, struct bch_dev *ca, u64 nbuckets) size_t btree_reserve = DIV_ROUND_UP(BTREE_NODE_RESERVE, ca->mi.bucket_size / c->opts.btree_node_size); /* XXX: these should be tunable */ - size_t reserve_none = max_t(size_t, 4, ca->mi.nbuckets >> 9); - size_t copygc_reserve = max_t(size_t, 16, ca->mi.nbuckets >> 7); - size_t free_inc_nr = max(max_t(size_t, 16, ca->mi.nbuckets >> 12), + size_t reserve_none = max_t(size_t, 4, nbuckets >> 9); + size_t copygc_reserve = max_t(size_t, 16, nbuckets >> 7); + size_t free_inc_nr = max(max_t(size_t, 16, nbuckets >> 12), btree_reserve); bool resize = ca->buckets != NULL, start_copygc = ca->copygc_thread != NULL; |