OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
To: no-reply@sashiko.virtuozzo.com, andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v2] drivers/vhost/blk: reject a head that is still in flight
Date: Thu, 29 Oct 2026 14:59:20 +0100	[thread overview]
Message-ID: <3e50af49-fc25-4582-a6ef-0cdb9fc3659c@virtuozzo.com> (raw)
In-Reply-To: <010701a187ef0e39-9ebdb65b-5f60-46e0-9a46-ae71a8f62bfa-000000@eu-central-1.amazonses.com>

>> @@ -457,6 +459,11 @@ static int vhost_blk_req_handle(struct vhost_virtqueue *vq,
>>   	u8 status;
>>   
>>   	req		= &blk_vq->req[head];
>> +	if (unlikely(req->inflight)) {
>> +		vhostblk_vq_err(blk, vq, "Guest reused in-flight head %d", head);
>> +		return -EBUSY;
>> +	}
>> +
> [Severity: Low]
> Is this error reported twice? vhostblk_vq_err() here already calls
> pr_warn_ratelimited() and eventfd_signal() on vq->error_ctx, and then
> -EBUSY is returned.
>
> In vhost_blk_handle_guest_kick(), only -EAGAIN and -ENOMEM are special-cased:
>
> 	ret = vhost_blk_req_handle(vq, &hdr, head, out, in);
> 	if (ret == -EAGAIN || ret == -ENOMEM) {
> 		...
> 	} else if (ret < 0) {
> 		vhostblk_vq_err(blk, vq, "Failed to process guest request (head %d) with %d",
> 				head, ret);
> 		break;
> 	}
>
> So -EBUSY reaches the second branch, which calls vhostblk_vq_err() again.
> That gives a second warning and a second eventfd_signal() for one guest
> misbehaviour.
>
> The commit message says "Log the head and let the caller report the error on
> the vq error eventfd". Should the vhostblk_vq_err() in vhost_blk_req_handle()
> be a plain log message, such as pr_warn_ratelimited(), so that only the
> caller signals the eventfd? Other early errors in this function, such as
> -EINVAL, are reported only by the caller.
The vhostblk_vq_err() was added at an earlier reviewer's request.
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  reply	other threads:[~2026-10-29 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 13:48 Alexander Ivanov
2026-10-29 13:52 ` no-reply
2026-10-29 13:59   ` Alexander Ivanov [this message]
2026-11-02 10:36 ` Konstantin Khorenko
2026-11-02 10: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=3e50af49-fc25-4582-a6ef-0cdb9fc3659c@virtuozzo.com \
    --to=alexander.ivanov@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=no-reply@sashiko.virtuozzo.com \
    /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