]> Gentwo Git Trees - linux/.git/commit
vhost: rewind next_avail_head while discarding descriptors
authorJason Wang <jasowang@redhat.com>
Thu, 20 Nov 2025 02:29:50 +0000 (10:29 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 26 Nov 2025 22:44:58 +0000 (14:44 -0800)
commit779bcdd4b9ae6566f309043c53c946e8ac0015fd
tree0bcafa42fb0c4efad98e1289630b6bad741256da
parent0ebc27a4c67d44e5ce88d21cdad8201862b78837
vhost: rewind next_avail_head while discarding descriptors

When discarding descriptors with IN_ORDER, we should rewind
next_avail_head otherwise it would run out of sync with
last_avail_idx. This would cause driver to report
"id X is not a head".

Fixing this by returning the number of descriptors that is used for
each buffer via vhost_get_vq_desc_n() so caller can use the value
while discarding descriptors.

Fixes: 67a873df0c41 ("vhost: basic in order support")
Cc: stable@vger.kernel.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://patch.msgid.link/20251120022950.10117-1-jasowang@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/vhost/net.c
drivers/vhost/vhost.c
drivers/vhost/vhost.h