Skip to content

Commit fa8e442

Browse files
Ming Leiaxboe
authored andcommitted
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: 71f28f3 ("ublk_drv: add io_uring based userspace block driver") Reported-by: Jens Axboe <[email protected]> Signed-off-by: Ming Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 9cea62b commit fa8e442

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/block/ublk_drv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,6 +1992,9 @@ static int ublk_ctrl_uring_cmd(struct io_uring_cmd *cmd,
19921992
struct ublksrv_ctrl_cmd *header = (struct ublksrv_ctrl_cmd *)cmd->cmd;
19931993
int ret = -EINVAL;
19941994

1995+
if (issue_flags & IO_URING_F_NONBLOCK)
1996+
return -EAGAIN;
1997+
19951998
ublk_ctrl_cmd_dump(cmd);
19961999

19972000
if (!(issue_flags & IO_URING_F_SQE128))

0 commit comments

Comments
 (0)