[Devel] [PATCH hci-8.2] Revert "drivers/vhost: add ioctl to increase the number of workers"
Konstantin Khorenko
khorenko at virtuozzo.com
Mon Nov 30 18:30:20 MSK 2026
Applying with these fixes on my side:
- message: name b3ed783d6715 next to 705a4b3eefde in the "This
reverts commit" line;
- message: -ENOTTY, or -ENOBUFS when the argument is not a valid vq
index;
- message: name the QEMU version that has the worker ioctls,
v10.1.0-20.vz10.33.
On Thu, 26 Nov 2026 09:16:46 +0100, Alexander Ivanov wrote:
> This reverts commit 705a4b3eefde336713aaa0b84b1b74e69dcdef30.
The diff also reverts b3ed783d6715 ("drivers/vhost: fix a
use-after-free of VHOST_SET_NWORKERS workers"): the removed lines with
__vhost_vq_attach_worker() and !d->use_worker come from it, and a plain
"git revert 705a4b3eefde" does not give this diff. Without its name a
later rebase keeps b3ed783d6715 with a Fixes: pointing to a dropped
commit.
> The 0x1F ioctl number is freed: VHOST_SET_NWORKERS now fails with
> -ENOTTY.
vhost_dev_ioctl() returns -ENOIOCTLCMD, and vhost_vring_ioctl() then
reads the int argument as a vq index: 32 or more on vhost-blk gives
-ENOBUFS. QEMU fails either way, so only the errno was off.
> mainstream worker ioctls" in QEMU) before this kernel ships.
The QEMU commit is 3b0b744f6c4 on hci-dev, first in
v10.1.0-20.vz10.33; with the version in the message packaging can
require it.
Separate patches, not needed for this patch. I created a task:
1. hci-8.1 still has 705a4b3eefde without b3ed783d6715, and its QEMU
still uses VHOST_SET_NWORKERS, so this revert does not fit there.
The owner of a vhost-scsi device can free a worker installed by
VHOST_SET_NWORKERS with VHOST_FREE_WORKER while a vq still uses
it: attachment_cnt is 0. b3ed783d6715 wants a backport to hci-8.1.
https://virtuozzo.atlassian.net/browse/VSTOR-157358
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
More information about the Devel
mailing list