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)
committerJens Axboe <axboe@kernel.dk>
Wed, 4 Jan 2023 20:24:53 +0000 (13:24 -0700)
commitfa8e442e832a3647cdd90f3e606c473a51bc1b26
treee1e4d1fb772779774238d8936f6ffb61b704af8c
parent9cea62b2cbabff8ed46f2df17778b624ad9dd25a
ublk: honor IO_URING_F_NONBLOCK for handling control command

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>
drivers/block/ublk_drv.c