diff mbox series

[09/11] block: mark the bio as cloned in bio_iov_bvec_set

Message ID 20210202171929.1504939-10-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [01/11] block: reuse BIO_INLINE_VECS for integrity bvecs | expand

Commit Message

Christoph Hellwig Feb. 2, 2021, 5:19 p.m. UTC
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>
 block/bio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/block/bio.c b/block/bio.c
index f753201238273b..a36f955cd120b0 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)
 	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;