]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
loop: aio inherit the ioprio of original request
authorYunlong Xing <yunlong.xing@unisoc.com>
Mon, 14 Apr 2025 03:01:59 +0000 (11:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:51:01 +0000 (07:51 +0200)
[ Upstream commit 1fdb8188c3d505452b40cdb365b1bb32be533a8e ]

Set cmd->iocb.ki_ioprio to the ioprio of loop device's request.
The purpose is to inherit the original request ioprio in the aio
flow.

Signed-off-by: Yunlong Xing <yunlong.xing@unisoc.com>
Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250414030159.501180-1-yunlong.xing@unisoc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/loop.c

index 8a6c1146df00fda6a9bbd269a7182ea6a1de16b3..455e2a2b149f4b7105124ff867426019da1c1c30 100644 (file)
@@ -441,7 +441,7 @@ static int lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd,
        cmd->iocb.ki_filp = file;
        cmd->iocb.ki_complete = lo_rw_aio_complete;
        cmd->iocb.ki_flags = IOCB_DIRECT;
-       cmd->iocb.ki_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0);
+       cmd->iocb.ki_ioprio = req_get_ioprio(rq);
 
        if (rw == ITER_SOURCE)
                ret = call_write_iter(file, &cmd->iocb, &iter);