summaryrefslogtreecommitdiff
path: root/fs/bcachefs/move.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-03-14 21:30:08 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:56 -0400
commit5ff75ccbbc3f262158e5bf02c639539a4da93a43 (patch)
tree184cf5fc1597cfe6117fbdff3e089a668e1ed234 /fs/bcachefs/move.c
parentc8d94403de0534030e43efce5c2f1d6c2d79dcda (diff)
downloadlwn-5ff75ccbbc3f262158e5bf02c639539a4da93a43.tar.gz
lwn-5ff75ccbbc3f262158e5bf02c639539a4da93a43.zip
bcachefs: Fix read retry path for indirect extents
In the read path, for retry of indirect extents to work we need to differentiate between the location in the btree the read was for, vs. the location where we found the data. This patch adds that plumbing to bch_read_bio. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/move.c')
-rw-r--r--fs/bcachefs/move.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c
index dfe7f05f39e9..3ff31d25f396 100644
--- a/fs/bcachefs/move.c
+++ b/fs/bcachefs/move.c
@@ -208,9 +208,9 @@ void bch2_migrate_read_done(struct migrate_write *m, struct bch_read_bio *rbio)
BUG_ON(!m->op.wbio.bio.bi_vcnt);
m->ptr = rbio->pick.ptr;
- m->offset = rbio->pos.offset - rbio->pick.crc.offset;
+ m->offset = rbio->data_pos.offset - rbio->pick.crc.offset;
m->op.devs_have = rbio->devs_have;
- m->op.pos = rbio->pos;
+ m->op.pos = rbio->data_pos;
m->op.version = rbio->version;
m->op.crc = rbio->pick.crc;
m->op.wbio.bio.bi_iter.bi_size = m->op.crc.compressed_size << 9;
@@ -492,7 +492,9 @@ static int bch2_move_extent(struct btree_trans *trans,
* ctxt when doing wakeup
*/
closure_get(&ctxt->cl);
- bch2_read_extent(trans, &io->rbio, k, 0,
+ bch2_read_extent(trans, &io->rbio,
+ bkey_start_pos(k.k),
+ btree_id, k, 0,
BCH_READ_NODECODE|
BCH_READ_LAST_FRAGMENT);
return 0;