block: copy ioprio in __bio_clone_fast()
PATCH 1/1 block: copy ioprio in __bio_clone_fast()
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 <[email protected]>
--- block/bio.c | 2 ++ 1 file changed, 2 insertions(+)
block/bio.c +2 -0
@@ -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 :
Signature · 1 line
2.12.3
Good catch,
Reviewed-by Johannes Thumshirn <[email protected]>
Signature · 6 lines
Johannes Thumshirn Storage [email protected] +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N�rnberg GF: Felix Imend�rffer, Jane Smithard, Graham Norton HRB 21284 (AG N�rnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Jens Axboe
maintainerQuoted 2 lines · Hannes Reinecke
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.
Signature · 1 line
Jens Axboe