ublk: honor IO_URING_F_NONBLOCK for handling control command
Subsystems (2)
PATCH 1/1 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 <[email protected]>
Signed-off-by Ming Lei <[email protected]>
--- drivers/block/ublk_drv.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/block/ublk_drv.c +3 -0
@@ -1992,6 +1992,9 @@ static int ublk_ctrl_uring_cmd(struct io_uring_cmd *cmd,struct ublksrv_ctrl_cmd *header = (struct ublksrv_ctrl_cmd *)cmd->cmd;int ret = -EINVAL ; +if (issue_flags &IO_URING_F_NONBLOCK ) +return -EAGAIN ; +ublk_ctrl_cmd_dump (cmd);if (!(issue_flags &IO_URING_F_SQE128 ))
Signature · 1 line
2.38.1
Quoted 4 lines · Ming Lei
Most of control command handlers may sleep, so return
-EAGAINin case ofIO_URING_F_NONBLOCKto defer the handling into io wq context.
Applied, thanks!
[1/1] ublk: honor IO_URING_F_NONBLOCK for handling control command
commit: 6a894753cef6494feb7e5332a95477f31212ebe9
Best regards,
Signature · 1 line
Jens Axboe