Commit 1539bdf5 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Fix bch2_read_retry_nodecode()



BCH_READ_NODECODE mode - used by the move paths - really wants to use
only the original rbio, but the retry path really wants to clone - oof.

Make sure to copy the crc of the pointer we read from back to the
original rbio, or we'll see spurious checksum errors later.

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 44ec5990
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1003,6 +1003,9 @@ int __bch2_read_extent(struct btree_trans *trans, struct bch_read_bio *orig,
	rbio->promote		= promote;
	INIT_WORK(&rbio->work, NULL);

	if (flags & BCH_READ_NODECODE)
		orig->pick = pick;

	rbio->bio.bi_opf	= orig->bio.bi_opf;
	rbio->bio.bi_iter.bi_sector = pick.ptr.offset;
	rbio->bio.bi_end_io	= bch2_read_endio;