summaryrefslogtreecommitdiff
path: root/block/bio.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-02-02 18:19:27 +0100
committerJens Axboe <axboe@kernel.dk>2021-02-08 08:33:16 -0700
commit977be01273844626ddeef4a464b42b99418d76e6 (patch)
treefd719c39aec963f3da5f658912ac0421ec04fb85 /block/bio.c
parented97ce5e1daf26d456760443fc89dc14d2b677e5 (diff)
block: mark the bio as cloned in bio_iov_bvec_set
bio_iov_bvec_set clones the bio_vecs from the iter, and thus should be treated like a cloned bio in every respect. That also includes not touching bi_max_vecs as that is a property of the bio allocation and not its current payload. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bio.c')
-rw-r--r--block/bio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/bio.c b/block/bio.c
index f75320123827..a36f955cd120 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -937,11 +937,11 @@ static int bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter)
WARN_ON_ONCE(BVEC_POOL_IDX(bio) != 0);
bio->bi_vcnt = iter->nr_segs;
- bio->bi_max_vecs = iter->nr_segs;
bio->bi_io_vec = (struct bio_vec *)iter->bvec;
bio->bi_iter.bi_bvec_done = iter->iov_offset;
bio->bi_iter.bi_size = iter->count;
bio_set_flag(bio, BIO_NO_PAGE_REF);
+ bio_set_flag(bio, BIO_CLONED);
iov_iter_advance(iter, iter->count);
return 0;