Re: [PATCH] ublk: dispatch the next fetch after a batch failure

From: Ming Lei

Date: Sun Nov 15 2026 - 06:11:59 EST


On Sat, Nov 14, 2026 at 10:33 AM <shao.mingyin@xxxxxxxxxx> wrote:
>
> From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
>
> When a batch fetch fails, for example because its provided-buffer group
> is empty, ublk_batch_dispatch() removes the failed fetch and returns.
> Pending I/O tags stay in evts_fifo even if another fetch with usable
> buffers is already queued. With no new I/O or fetch submission to select
> it, that fetch and the outstanding block requests cannot make progress.
>
> Claim the next queued fetch under evts_lock before completing and freeing
> the failed one, then schedule its dispatch in the proper task context.
> Marking it active before dropping the lock also prevents cancellation
> from taking it before its task work is queued.
>
> Fixes: a4d883755399 ("ublk: add UBLK_U_IO_FETCH_IO_CMDS for batch I/O processing")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>

Reviewed-by: Ming Lei <tom.leiming@xxxxxxxxx>

Thanks,
Ming