Skip to content

Commit 5d8d408

Browse files
Hongyu JinMike Snitzer
authored andcommitted
dm crypt: Fix IO priority lost when queuing write bios
Since dm-crypt queues writes to a different kernel thread (workqueue), the bios will dispatch from tasks with different io_context->ioprio settings and blkcg than the submitting task, thus giving incorrect ioprio to the io scheduler. Get the original IO priority setting via struct dm_crypt_io::base_bio and set this priority in the bio for write. Link: https://lore.kernel.org/dm-devel/[email protected] Signed-off-by: Hongyu Jin <[email protected]> Reviewed-by: Eric Biggers <[email protected]> Reviewed-by: Mikulas Patocka <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent d95e2c3 commit 5d8d408

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/md/dm-crypt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,7 @@ static struct bio *crypt_alloc_buffer(struct dm_crypt_io *io, unsigned int size)
16881688
GFP_NOIO, &cc->bs);
16891689
clone->bi_private = io;
16901690
clone->bi_end_io = crypt_endio;
1691+
clone->bi_ioprio = io->base_bio->bi_ioprio;
16911692

16921693
remaining_size = size;
16931694

0 commit comments

Comments
 (0)