OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: Alexander Ivanov <alexander.ivanov@virtuozzo.com>,
	andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1] drivers/vhost/blk: drop completed requests when the vq has no worker
Date: Wed, 18 Nov 2026 16:53:34 +0000	[thread overview]
Message-ID: <010701a1ef93fa6a-f5176fd3-c100-41d1-9b75-e8852d0a1ade-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261118164637.3464286-1-alexander.ivanov@virtuozzo.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] vhost/blk: bug-fix commit lacks a Fixes: trailer
- [Low] vhost-blk: vhost_blk_drop_req() leaves req->inflight set on
  dropped requests
--

commit ee94643eb92be4e55fe58e2e2a5d609d57dc2319
Author: Alexander Ivanov <alexander.ivanov@virtuozzo.com>

drivers/vhost/blk: drop completed requests when the vq has no worker

When vhost_blk_req_done() finds that the vq has no worker, it now frees the request from a work item on the system workqueue. The patch also holds an extra req_inflight[] reference while the callback uses blk, and makes flush_lock irq-safe.

> drivers/vhost/blk: drop completed requests when the vq has no worker
>
> vhost_blk_req_done() ignores the return value of vhost_vq_work_queue().
> Once a vhost_task worker is killed, vhost_worker_killed() clears
> vq->worker, so a request completing after that stays on llhead forever:
> its bio, iov and bounce buffer leak and req_inflight[] is never
> decremented. vhost_blk_flush() then waits for it with no timeout, which
> hangs release, VHOST_RESET_OWNER and VHOST_SET_FEATURES.
>
> Free such requests from a work item on the system workqueue.
> [ ... ]
>
> Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>

[Severity: Low]
This looks like a bug fix for a long-standing ignored return value in
vhost_blk_req_done().  Should this include:

  Fixes: c57a98d65796 ("drivers/vhost: vhost-blk accelerator for virtio-blk guests")

If 386033c1c98d ("drivers/vhost/blk: fix vhost_blk_req_done() softirq
handling") is judged the real introducer, it could point there instead.

> diff --git a/drivers/vhost/blk.c b/drivers/vhost/blk.c
> index b95358cdf3bc0..cb966e52acdd0 100644
> --- a/drivers/vhost/blk.c
> +++ b/drivers/vhost/blk.c

[ ... ]

> @@ -394,22 +404,45 @@ static inline void vhost_blk_bio_send(struct vhost_blk_req *req)
[ ... ]
> +static void vhost_blk_drop_req(struct vhost_blk_req *req)
> +{
> +	vhost_blk_req_cleanup(req);
> +	forget_request(req);
> +}

[Severity: Low]
Should vhost_blk_drop_req() clear req->inflight before forget_request(),
the way vhost_blk_handle_host_kick() does on normal completion?

A dropped request stays marked inflight in blk_vq->req[head].  If the
worker was killed, a new one is attached with VHOST_NEW_WORKER plus
VHOST_ATTACH_VRING_WORKER, and the guest then reuses that head,
vhost_blk_req_handle() fails with -EBUSY ("Guest reused in-flight head")
and the vq is stopped.

The commit message also does not say that dropped requests are never
completed to the guest.

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

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

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

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  reply	other threads:[~2026-11-18 16:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 16:46 Alexander Ivanov
2026-11-18 16:53 ` no-reply [this message]
2026-11-19  7:24 ` Alexander Ivanov
2026-11-19 11:36   ` Konstantin Khorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=010701a1ef93fa6a-f5176fd3-c100-41d1-9b75-e8852d0a1ade-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=alexander.ivanov@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=devel@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox