From 37954a275fce612f60406bc79f5bc0b07b4b6558 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 8 Oct 2019 18:45:29 -0400 Subject: bcachefs: Limit pointers to being in only one stripe This make the disk accounting code saner, and it's not clear why we'd ever want the same data to be in multiple stripes simultaneously. Signed-off-by: Kent Overstreet --- fs/bcachefs/ec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'fs/bcachefs/ec.c') diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index 424d5cf48893..316dd82809ff 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -433,10 +433,9 @@ int bch2_ec_read_extent(struct bch_fs *c, struct bch_read_bio *rbio) closure_init_stack(&cl); - BUG_ON(!rbio->pick.idx || - rbio->pick.idx - 1 >= rbio->pick.ec_nr); + BUG_ON(!rbio->pick.has_ec); - stripe_idx = rbio->pick.ec[rbio->pick.idx - 1].idx; + stripe_idx = rbio->pick.ec.idx; buf = kzalloc(sizeof(*buf), GFP_NOIO); if (!buf) -- cgit v1.2.3