Re: [PATCH] ublk: allow non-blocking ctrl cmds in IO_URING_F_NONBLOCK issue

From: Ming Lei
Date: Mon Dec 08 2025 - 02:59:57 EST


On Mon, Dec 01, 2025 at 02:41:44PM -0700, Caleb Sander Mateos wrote:
> Handling most of the ublksrv_ctrl_cmd opcodes require locking a mutex,
> so ublk_ctrl_uring_cmd() bails out with EAGAIN when called with the
> IO_URING_F_NONBLOCK issue flag. However, several opcodes can be handled
> without blocking:
> - UBLK_CMD_GET_QUEUE_AFFINITY
> - UBLK_CMD_GET_DEV_INFO
> - UBLK_CMD_GET_DEV_INFO2
> - UBLK_U_CMD_GET_FEATURES
>
> Handle these opcodes synchronously instead of returning EAGAIN so
> io_uring doesn't need to issue the command via the worker thread pool.
>
> Signed-off-by: Caleb Sander Mateos <csander@xxxxxxxxxxxxxxx>

Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx>


Thanks,
Ming