linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: Make __bio_clone_fast() copy bi_vcnt
@ 2018-06-27 20:12 Bart Van Assche
  2018-06-27 23:50 ` Ming Lei
  2018-06-28 15:53 ` Jens Axboe
  0 siblings, 2 replies; 15+ messages in thread
From: Bart Van Assche @ 2018-06-27 20:12 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Mike Snitzer,
	Ming Lei, Hannes Reinecke, Johannes Thumshirn

Although __bio_clone_fast() copies bi_io_vec, it does not copy bi_vcnt,
the number of elements in bi_io_vec[] that contains data. Copy bi_vcnt
such that code that needs this member behaves identically for original
and for cloned requests.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
---
 block/bio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/bio.c b/block/bio.c
index f7e3d88bd0b6..55f8e0dedd69 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -605,6 +605,7 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src)
 	bio->bi_opf = bio_src->bi_opf;
 	bio->bi_write_hint = bio_src->bi_write_hint;
 	bio->bi_iter = bio_src->bi_iter;
+	bio->bi_vcnt = bio_src->bi_vcnt;
 	bio->bi_io_vec = bio_src->bi_io_vec;
 
 	bio_clone_blkcg_association(bio, bio_src);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-06-30 23:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-27 20:12 [PATCH] block: Make __bio_clone_fast() copy bi_vcnt Bart Van Assche
2018-06-27 23:50 ` Ming Lei
2018-06-27 23:59   ` Bart Van Assche
2018-06-28  0:30     ` Ming Lei
2018-06-28 15:21       ` Bart Van Assche
2018-06-28 15:32         ` Mike Snitzer
2018-06-28 23:10         ` [PATCH] " Ming Lei
2018-06-28 23:16           ` Kent Overstreet
2018-06-28 23:54             ` Bart Van Assche
2018-06-29  0:04               ` Kent Overstreet
2018-06-29 20:00                 ` Bart Van Assche
2018-06-30 23:38                   ` Kent Overstreet
2018-06-29  2:18             ` Jens Axboe
2018-06-28 15:53 ` Jens Axboe
2018-06-28 22:53   ` Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).