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

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Tue Dec 1 04:19:33 MSK 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] vhost-blk: VHOST_BLK_RESUBMIT UAPI comment does not classify
  per-entry errors
--

commit c41691157d67540de9d6e902ad4867c2a36f683f
Author: Alexander Ivanov <alexander.ivanov at virtuozzo.com>

drivers/vhost/blk: add the VHOST_BLK_RESUBMIT ioctl

The patch adds an owner-only ioctl that takes the vq and head pairs read
with VHOST_BLK_GET_HELD_REQS. It parses the descriptor chain of each head
and submits the request as if it had just been taken from the avail ring.

> diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h
> index 21bf6e39a85a..fdf6a3520938 100644
> --- a/include/uapi/linux/vhost.h
> +++ b/include/uapi/linux/vhost.h
> @@ -296,4 +296,17 @@
>   */
>  #define VHOST_BLK_GET_HELD_REQS		_IOWR(VHOST_VIRTIO, 0xFB, \
>  					      struct vhost_blk_held_reqs)
> +
> +/*
> + * Resubmit requests by vq and head, as if they were just taken from the avail
> + * ring. Only heads read with VHOST_BLK_GET_HELD_REQS after the last stop may be
> + * passed: the kernel does not track them. A head passed again after its request
> + * completed, still owned by the guest, or reused by the guest since the backend
> + * was set, is completed twice, or fails with -EBUSY while still in flight.
> + * error and type are ignored, reserved must be 0. On error, nr is set to the
> + * index of the entry that failed; the entries before it were resubmitted.
> + * Fails with -ENODEV until the backend is set.
> + */
> +#define VHOST_BLK_RESUBMIT		_IOWR(VHOST_VIRTIO, 0xFA, \
> +					      struct vhost_blk_held_reqs)
>  #endif

[Severity: Low]
As reported by Konstantin Khorenko on v1 [1], this comment does not say
what userspace should do with the entry that failed. Which errors are
transient, so the same entry can be retried? Which are permanent, so it
should be skipped?

vhost_blk_resubmit() stops at the first non-zero return. That can be
-ENOMEM or -EAGAIN from the descriptor parsing and request submission,
-EINTR from the loop, or -EFAULT, -EINVAL, -EBUSY or -ENODEV from
vhost_blk_resubmit_one(). Without a documented rule, one bad entry can
block every held request after it, and userspace cannot tell whether to
retry, skip or give up.

[1] https://lore.kernel.org/r/179578030084.10258.14556640974201502480.b4-review@b4

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261130162507.1822477-1-alexander.ivanov@virtuozzo.com?part=4



More information about the Devel mailing list