[Devel] [PATCH hci-8.2 v3 0/4] drivers/vhost/blk: hold requests failed with ENOSPC until QEMU resubmits them

Konstantin Khorenko khorenko at virtuozzo.com
Tue Dec 1 12:19:07 MSK 2026


I won't apply this version, please send v4 with the changes below.
The code is fine; only the uapi comments and one sentence change.

On Tue, 1 Dec 2026 09:50:16 +0100, Alexander Ivanov wrote:
> - patch 4: say in the uapi which VHOST_BLK_RESUBMIT errors fail the
>   rest of the entries and which concern only the failed one

My v2 reply never went out, sorry: items 1, 2, 3 and 5 are from it.

1. Patch 3: the VHOST_BLK_GET_HELD_REQS comment: after a failing
   VHOST_BLK_SET_BACKEND the list may also hold requests held during
   it, so QEMU reads it again.
2. Patch 3 message: "Until then its head stays taken" - say "while
   the backend is set".
3. Patch 4: the VHOST_BLK_RESUBMIT comment: nr when the call fails
   before the first entry (-EPERM, a fault on the header, reserved
   not 0). Set it to 0, or say these errors leave it unchanged.
4. Patch 4: the same comment: an -EFAULT on reading an entry fails
   the rest, like -ENODEV and -EINTR, not only that entry.
5. Patch 4: the same comment: say that the guest request of a
   skipped entry is never completed.

The v3 copy of the held list outside held_mutex is fine: blk->held
changes only under dev.mutex, which the ioctl holds, and new entries
go past nr_held.

Separate patches, not needed for this series. I created a task:

1. vhost-blk: vhost_blk_req_cleanup() frees a kmalloc'ed req->bio
   array but leaves the pointer set, and nothing resets it for the
   next request on that head. If that request needs a bounce buffer
   and its kvmalloc or the copy into it fails, err_req frees the old
   array again. A guest can steer it, and the -ENOMEM retry of
   RESUBMIT takes the same path.
   https://virtuozzo.atlassian.net/browse/VSTOR-158259

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list