Commit 9ad26b2b authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Make sure bch2_read_extent obeys BCH_READ_MUST_CLONE

This fixes the bch2_read_retry_nodecode() path, we were resubmitting a
bio without properly reinitializing it.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 24326cd1
...@@ -1981,7 +1981,7 @@ int __bch2_read_extent(struct bch_fs *c, struct bch_read_bio *orig, ...@@ -1981,7 +1981,7 @@ int __bch2_read_extent(struct bch_fs *c, struct bch_read_bio *orig,
goto hole; goto hole;
iter.bi_size = pick.crc.compressed_size << 9; iter.bi_size = pick.crc.compressed_size << 9;
goto noclone; goto get_bio;
} }
if (!(flags & BCH_READ_LAST_FRAGMENT) || if (!(flags & BCH_READ_LAST_FRAGMENT) ||
...@@ -2028,7 +2028,7 @@ int __bch2_read_extent(struct bch_fs *c, struct bch_read_bio *orig, ...@@ -2028,7 +2028,7 @@ int __bch2_read_extent(struct bch_fs *c, struct bch_read_bio *orig,
pick.crc.live_size = bvec_iter_sectors(iter); pick.crc.live_size = bvec_iter_sectors(iter);
offset_into_extent = 0; offset_into_extent = 0;
} }
get_bio:
if (rbio) { if (rbio) {
/* /*
* promote already allocated bounce rbio: * promote already allocated bounce rbio:
...@@ -2068,7 +2068,6 @@ int __bch2_read_extent(struct bch_fs *c, struct bch_read_bio *orig, ...@@ -2068,7 +2068,6 @@ int __bch2_read_extent(struct bch_fs *c, struct bch_read_bio *orig,
rbio->bio.bi_iter = iter; rbio->bio.bi_iter = iter;
rbio->split = true; rbio->split = true;
} else { } else {
noclone:
rbio = orig; rbio = orig;
rbio->bio.bi_iter = iter; rbio->bio.bi_iter = iter;
EBUG_ON(bio_flagged(&rbio->bio, BIO_CHAIN)); EBUG_ON(bio_flagged(&rbio->bio, BIO_CHAIN));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment