From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 3/4] drivers/vhost/blk: hold requests failed with ENOSPC
Date: Fri, 27 Nov 2026 12:51:40 +0100 [thread overview]
Message-ID: <179578030084.10258.18214528503636203075.b4-review@b4> (raw)
In-Reply-To: <20261127111604.1151696-4-alexander.ivanov@virtuozzo.com>
Items 1, 2 and 3 of the cover letter reply; item 6 is about this patch too.
On Fri, 27 Nov 2026 12:16:02 +0100, Alexander Ivanov wrote:
> A held request is not counted as inflight, so that unsetting the
> backend does not wait for it. Its head stays taken, so a guest reusing
> it gets the same error as for a head in flight.
Item 1. Only until the backend is unset: vhost_blk_drop_backend() frees
blk->vqs[i].req, and vhost_blk_setup_vqs() allocates it zeroed, so
after the stop and start QEMU does before VHOST_BLK_RESUBMIT the head
is free. A guest that reuses it then gets it accepted, and the later
RESUBMIT of that head fails with -EBUSY or completes it twice. Only
that guest is hurt, so saying it is enough, but the sentence and the
uapi comment must not promise more.
> + held = kvcalloc(nr, sizeof(*held), GFP_KERNEL);
> + if (!held)
> + return -ENOMEM;
> + vhost_blk_reset_held(blk, held);
Item 2. The old list is dropped here, before the vq setup below can
still fail. QEMU needs that list to resubmit, so a failed
VHOST_BLK_SET_BACKEND loses the held heads and the guest waits for
them forever. Swap the new list in once the setup succeeded, and drop
"A failing one may empty it too" from the uapi comment.
> err = blk_status_to_errno(bio->bi_status);
> if (err)
> req->bio_err = err;
Item 3. A request split into several bios keeps the error of the bio
that completes last. One bio failing with EIO and another with ENOSPC
make the request held or failed depending on completion order, and a
held EIO comes back on every resume. Keep the first error, or let any
error other than ENOSPC win.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-27 11:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 11:15 [Devel] [PATCH hci-8.2 0/4] drivers/vhost/blk: hold requests failed with ENOSPC until QEMU resubmits them Alexander Ivanov
2026-11-27 11:16 ` [Devel] [PATCH hci-8.2 1/4] drivers/vhost: split the descriptor chain walk out of vhost_get_vq_desc() Alexander Ivanov
2026-11-27 11:16 ` [Devel] [PATCH hci-8.2 2/4] drivers/vhost/blk: split request parsing out of the guest kick handler Alexander Ivanov
2026-11-27 11:16 ` [Devel] [PATCH hci-8.2 3/4] drivers/vhost/blk: hold requests failed with ENOSPC Alexander Ivanov
2026-11-27 11:51 ` Konstantin Khorenko [this message]
2026-11-27 11:16 ` [Devel] [PATCH hci-8.2 4/4] drivers/vhost/blk: add the VHOST_BLK_RESUBMIT ioctl Alexander Ivanov
2026-11-27 11:51 ` Konstantin Khorenko
2026-11-27 11:51 ` [Devel] [PATCH hci-8.2 0/4] drivers/vhost/blk: hold requests failed with ENOSPC until QEMU resubmits them Konstantin Khorenko
2026-11-30 10:52 ` Alexander Ivanov
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=179578030084.10258.18214528503636203075.b4-review@b4 \
--to=khorenko@virtuozzo.com \
--cc=alexander.ivanov@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