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 <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>
1 parent 9cea62b commit fa8e442

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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)