diff options
author | Hongyu Jin <hongyu.jin@unisoc.com> | 2024-01-24 13:35:56 +0800 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2024-02-20 14:22:55 -0500 |
commit | 5d8d40815314684af2593c075e6eee1afb42bb92 (patch) | |
tree | eb5ad49cd4f8932d9716f3ca481164253f7c627f | |
parent | d95e2c34a3ca76861014cde4205934e434c27c45 (diff) | |
download | linux-stable-5d8d40815314684af2593c075e6eee1afb42bb92.tar.gz linux-stable-5d8d40815314684af2593c075e6eee1afb42bb92.tar.bz2 linux-stable-5d8d40815314684af2593c075e6eee1afb42bb92.zip |
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/alpine.LRH.2.11.1612141049250.13402@mail.ewheeler.net
Signed-off-by: Hongyu Jin <hongyu.jin@unisoc.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
-rw-r--r-- | drivers/md/dm-crypt.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 7388f45ada07..50467f005177 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1688,6 +1688,7 @@ retry: GFP_NOIO, &cc->bs); clone->bi_private = io; clone->bi_end_io = crypt_endio; + clone->bi_ioprio = io->base_bio->bi_ioprio; remaining_size = size; |