[Devel] [PATCH hci-8.2 4/4] drivers/vhost/blk: add the VHOST_BLK_RESUBMIT ioctl

Konstantin Khorenko khorenko at virtuozzo.com
Fri Nov 27 14:51:40 MSK 2026


Items 4 and 5 of the cover letter reply.

On Fri, 27 Nov 2026 12:16:03 +0100, Alexander Ivanov wrote:
> +	ret = vhost_get_desc_chain(vq, r->head, vq->iov, ARRAY_SIZE(vq->iov),
> +				   &out, &in, NULL, NULL);
> +	if (!ret && blk->vqs[r->vq].req[r->head].inflight)
> +		ret = -EBUSY;

Item 4. The message says a head in flight fails "before it reaches the
request parser, which would report it as a guest error". But the chain
walk runs first: a head out of range from QEMU hits vq_err("Guest says
index %u > %u is available") and signals the vring error eventfd,
which QEMU takes for a guest error. Check r->head < vq->num and the
in-flight flag before vhost_get_desc_chain().

> + * still in flight fails with -EBUSY. error and type are ignored, reserved
> + * must be 0. On error, nr is set to the number of requests resubmitted.

Item 5. Say that entry nr is the one that failed, and which errors let
QEMU retry it (-ENOMEM, -EINTR) and which mean it is to be skipped
(-EBUSY, -EINVAL). Otherwise one bad entry blocks every held request
after it.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list