ublk: honor IO_URING_F_NONBLOCK for handling control command
authorMing Lei <ming.lei@redhat.com>
Wed, 4 Jan 2023 13:32:35 +0000 (21:32 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 11:02:32 +0000 (12:02 +0100)
commit4e0c2961e53d22114c9a0505cfe90627e845e97a
tree0084816d790a126c21c73f348b4c03d4f7ff4dc6
parent1022519da69d99d455c58ca181a6c499c562c70e
ublk: honor IO_URING_F_NONBLOCK for handling control command

[ Upstream commit fa8e442e832a3647cdd90f3e606c473a51bc1b26 ]

Most of control command handlers may sleep, so return -EAGAIN in case
of IO_URING_F_NONBLOCK to defer the handling into io wq context.

Fixes: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver")
Reported-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20230104133235.836536-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/ublk_drv.c