summaryrefslogtreecommitdiff
path: root/fs/bcachefs/io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-01-03 16:03:10 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:34 -0400
commit9ad26b2b568f75ee6872a3afa70fa8005994efe8 (patch)
tree02a8fb6ef7f1d4dffd1c2ba9a1058fe130d1ce48 /fs/bcachefs/io.c
parent24326cd12aa03ea2c6808d09d285af2cecfa4789 (diff)
downloadlwn-9ad26b2b568f75ee6872a3afa70fa8005994efe8.tar.gz
lwn-9ad26b2b568f75ee6872a3afa70fa8005994efe8.zip
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: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/io.c')
-rw-r--r--fs/bcachefs/io.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c
index 1fab0bdcf9ae..a419024ce039 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -1981,7 +1981,7 @@ int __bch2_read_extent(struct bch_fs *c, struct bch_read_bio *orig,
goto hole;
iter.bi_size = pick.crc.compressed_size << 9;
- goto noclone;
+ goto get_bio;
}
if (!(flags & BCH_READ_LAST_FRAGMENT) ||
@@ -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);
offset_into_extent = 0;
}
-
+get_bio:
if (rbio) {
/*
* promote already allocated bounce rbio:
@@ -2068,7 +2068,6 @@ int __bch2_read_extent(struct bch_fs *c, struct bch_read_bio *orig,
rbio->bio.bi_iter = iter;
rbio->split = true;
} else {
-noclone:
rbio = orig;
rbio->bio.bi_iter = iter;
EBUG_ON(bio_flagged(&rbio->bio, BIO_CHAIN));