Skip to content

Commit 253a783

Browse files
Ming Leigregkh
authored andcommitted
ublk: honor IO_URING_F_NONBLOCK for handling control command
[ Upstream commit fa8e442 ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent bb84f2e commit 253a783

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
@@ -1718,6 +1718,9 @@ static int ublk_ctrl_uring_cmd(struct io_uring_cmd *cmd,
17181718
struct ublksrv_ctrl_cmd *header = (struct ublksrv_ctrl_cmd *)cmd->cmd;
17191719
int ret = -EINVAL;
17201720

1721+
if (issue_flags & IO_URING_F_NONBLOCK)
1722+
return -EAGAIN;
1723+
17211724
ublk_ctrl_cmd_dump(cmd);
17221725

17231726
if (!(issue_flags & IO_URING_F_SQE128))

0 commit comments

Comments
 (0)