summaryrefslogtreecommitdiff
path: root/fs/bcachefs/debug.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-11-03 20:04:54 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2018-11-03 20:11:06 -0400
commita780698e2947c2c072071e44aaa9eed1b59258b1 (patch)
tree163d14e94141267072446cfaf4c3a21a819db60e /fs/bcachefs/debug.c
parentfc7576d28a3fa67088be08df2ac2b986a3b82e9e (diff)
bcachefs: Some fixes for building in userspace
userspace allocators don't align allocations as nicely as kernel allocators, which meant that in some cases we weren't allocating big enough bvec arrays - just make the calculations more rigorous and explicit to fix it.
Diffstat (limited to 'fs/bcachefs/debug.c')
-rw-r--r--fs/bcachefs/debug.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c
index 50aac3a4a818..f69d76ec1e78 100644
--- a/fs/bcachefs/debug.c
+++ b/fs/bcachefs/debug.c
@@ -62,7 +62,9 @@ void __bch2_btree_verify(struct bch_fs *c, struct btree *b)
if (!bch2_dev_get_ioref(ca, READ))
return;
- bio = bio_alloc_bioset(GFP_NOIO, btree_pages(c), &c->btree_bio);
+ bio = bio_alloc_bioset(GFP_NOIO,
+ buf_pages(n_sorted, btree_bytes(c)),
+ &c->btree_bio);
bio_set_dev(bio, ca->disk_sb.bdev);
bio->bi_opf = REQ_OP_READ|REQ_META;
bio->bi_iter.bi_sector = pick.ptr.offset;