All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
Subject: [Devel] [PATCH VZ10 0/5] vhost-blk: fix protocol handling and backend setup
Date: Tue, 18 Aug 2026 18:09:15 +0300	[thread overview]
Message-ID: <20260818150920.13123-1-andrey.zhadchenko@virtuozzo.com> (raw)

This series fixes several vhost-blk bugs and harden some userspace
interactions.

First patch hardens VIRTIO_BLK_T_GET_ID. Leave the serial empty and
copy the null terminator, just as QEMU.

The second patch reports the correct used-ring length: the number of
bytes written to the guest, including status.

The third patch fixes flush. REQ_OP_FLUSH is not a valid bio op; use
REQ_OP_WRITE | REQ_PREFLUSH as blkdev_issue_flush() does.

The fourth patch fixes sector alignment checks. SECTOR_MASK is 7, not
a bitmask, so the code was checking 8-byte alignment. Use
(SECTOR_SIZE - 1).

The last patch reworks queue/backend setup. vhost_blk_setup() silently
ignored a changed vq->num once requests were allocated and
double-fetched user input. Request allocation is now tied to backend
existence, and drop_backend/flush/fput are consolidated.

Andrey Zhadchenko (5):
  drivers/vhost/blk: harden get_id command
  drivers/vhost/blk: report correct used-ring lengths
  drivers/vhost/blk: fix flush support
  drivers/vhost/blk: fix sector alignment calculation
  drivers/vhost/blk: rework queue/backend setup

 drivers/vhost/blk.c | 162 ++++++++++++++++++++------------------------
 1 file changed, 74 insertions(+), 88 deletions(-)

-- 
2.43.5

             reply	other threads:[~2026-08-18 15:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18 15:09 Andrey Zhadchenko [this message]
2026-08-18 15:09 ` [Devel] [PATCH VZ10 1/5] drivers/vhost/blk: harden get_id command Andrey Zhadchenko
2026-08-18 15:09 ` [Devel] [PATCH VZ10 2/5] drivers/vhost/blk: report correct used-ring lengths Andrey Zhadchenko
2026-08-20 14:11   ` Vasileios Almpanis
2026-08-24 15:04     ` Andrey Zhadchenko
2026-08-18 15:09 ` [Devel] [PATCH VZ10 3/5] drivers/vhost/blk: fix flush support Andrey Zhadchenko
2026-08-18 15:09 ` [Devel] [PATCH VZ10 4/5] drivers/vhost/blk: fix sector alignment calculation Andrey Zhadchenko
2026-08-18 22:57   ` Andrey Zhadchenko
2026-08-18 15:09 ` [Devel] [PATCH VZ10 5/5] drivers/vhost/blk: rework queue/backend setup Andrey Zhadchenko
2026-08-20 14:11   ` Vasileios Almpanis

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=20260818150920.13123-1-andrey.zhadchenko@virtuozzo.com \
    --to=andrey.zhadchenko@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.