summaryrefslogtreecommitdiff
path: root/fs/bcachefs/ec.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-10-09 01:45:29 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:29 +0300
commit37954a275fce612f60406bc79f5bc0b07b4b6558 (patch)
tree14acd88d70f6424860f91195622a167ef4eb1374 /fs/bcachefs/ec.c
parent9ef6068c4dce124235b335847570ae8f2bf2911d (diff)
downloadlinux-37954a275fce612f60406bc79f5bc0b07b4b6558.tar.xz
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 <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.c')
-rw-r--r--fs/bcachefs/ec.c5
1 files changed, 2 insertions, 3 deletions
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)