Re: [PATCH 2/2] selftests: ublk: make the fault_inject delay a pure timeout

From: Ming Lei

Date: Fri Oct 09 2026 - 10:13:06 EST


On Thu, Oct 08, 2026 at 10:45:40PM +0800, Qiliang Yuan wrote:
> ublk_fault_inject_queue_io() queues the delay of each I/O as an
> IORING_OP_TIMEOUT with a completion count of 1. Such a timeout also
> completes as soon as any other CQE is posted on the ring.
>
> With more than one I/O in flight, the completion of one I/O ends the
> delay of the others, and ublk_fault_inject_tgt_io_done() reports every
> early completion as "unexpected cqe res 0".
>
> Pass a count of 0 so that only the expiry of the timer completes the
> timeout.
>
> fio 4k random reads for 10 s at queue depth 4 on a fault_inject device
> with --delay_us 1000000:
>
> before after expected
> I/Os 2263170 40 40
> mean latency 16.3 us 1.000 s 1 s
> "unexpected cqe res 0" 2263169 0 0
>
> Fixes: 81586652bb1f ("selftests: ublk: add generic_06 for covering fault inject")
> Signed-off-by: Qiliang Yuan <odys.yuan@xxxxxxxxx>

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

Thanks,
Ming