diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-10-08 18:45:29 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:29 -0400 |
commit | 37954a275fce612f60406bc79f5bc0b07b4b6558 (patch) | |
tree | 14acd88d70f6424860f91195622a167ef4eb1374 /fs/bcachefs/ec.c | |
parent | 9ef6068c4dce124235b335847570ae8f2bf2911d (diff) | |
download | lwn-37954a275fce612f60406bc79f5bc0b07b4b6558.tar.gz lwn-37954a275fce612f60406bc79f5bc0b07b4b6558.zip |
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.c | 5 |
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) |