diff mbox series

block: copy ioprio in __bio_clone_fast()

Message ID 20180801143809.5472-1-hare@suse.de (mailing list archive)
State New, archived
Headers show
Series block: copy ioprio in __bio_clone_fast() | expand

Commit Message

Hannes Reinecke Aug. 1, 2018, 2:38 p.m. UTC
We need to copy the io priority, too; otherwise the clone will run
with a different priority than the original one.

Fixes: 43b62ce3ff0a ("block: move bio io prio to a new field")
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 block/bio.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Johannes Thumshirn Aug. 1, 2018, 2:40 p.m. UTC | #1
Good catch,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Jens Axboe Aug. 1, 2018, 3:17 p.m. UTC | #2
On 8/1/18 8:38 AM, Hannes Reinecke wrote:
> We need to copy the io priority, too; otherwise the clone will run
> with a different priority than the original one.

Looks good, but please make the patch against the block 4.19 branch.
diff mbox series

Patch

diff --git a/block/bio.c b/block/bio.c
index 8ecc95615941..88129f20623d 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -608,6 +608,7 @@  void __bio_clone_fast(struct bio *bio, struct bio *bio_src)
 	bio->bi_write_hint = bio_src->bi_write_hint;
 	bio->bi_iter = bio_src->bi_iter;
 	bio->bi_io_vec = bio_src->bi_io_vec;
+	bio->bi_ioprio = bio_src->bi_ioprio;
 
 	bio_clone_blkcg_association(bio, bio_src);
 }
@@ -692,6 +693,7 @@  struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask,
 	bio->bi_write_hint	= bio_src->bi_write_hint;
 	bio->bi_iter.bi_sector	= bio_src->bi_iter.bi_sector;
 	bio->bi_iter.bi_size	= bio_src->bi_iter.bi_size;
+	bio->bi_ioprio		= bio_src->bi_ioprio;
 
 	switch (bio_op(bio)) {
 	case REQ_OP_DISCARD: