From: "Denis V. Lunev" <den@openvz.org>
To: svt-core@virtuozzo.com
Cc: andrey.drobyshev@virtuozzo.com, den@openvz.org
Subject: [PATCH hci-8.0 0/5] nbd/server: accept a large NBD_CMD_CACHE #VSTOR-119829
Date: Mon, 31 Aug 2026 17:25:23 +0200 [thread overview]
Message-ID: <20260831152528.1350583-1-den@openvz.org> (raw)
Backport of the upstream series which lets the NBD server accept an
NBD_CMD_CACHE whose effect length is above the advertised maximum
payload size.
vz_backup_client prefetches through NBD_CMD_CACHE and is refused as
soon as it asks for more than 32 MiB, which is what VSTOR-119667 hit:
failed to prefetch 28114944:33619968: 'nbd_cache: cache: command
failed: Invalid argument'
33619968 is 32 MiB plus 64 KiB. The command carries no payload in
either direction, and the specification lets a client ask for an
effect length larger than the maximum payload size, which we already
allow for NBD_CMD_TRIM and NBD_CMD_WRITE_ZEROES. Patch 2 drops the
check, so a client may prefetch as much as it likes in one request.
The advertised maximum is unchanged and still bounds NBD_CMD_READ and
NBD_CMD_WRITE.
Patches 1, 3, 4 and 5 add tests/qemu-iotests/tests/nbd-commands, a
libnbd driven client which speaks the transmission phase itself. It
pins patch 2 and covers the reply modes, the command flags and the
sparse replies, none of which any test in the tree reached. The test
is skipped where the libnbd python bindings are missing, the same way
nbd-multiconn already is.
The series applies to the branch unchanged. The python iotests cannot
run on my host against this branch, since its python/qemu asyncio shim
predates Python 3.13 and nbd-multiconn fails there the same way, so the
new test was exercised upstream rather than here. The fix itself was
checked against qemu-nbd from this build: a 64 MiB NBD_CMD_CACHE is
refused with EINVAL before the change and accepted after it, and the
advertised maximum payload size stays at 32 MiB.
Upstream posting, reviewed by the block maintainer:
https://lore.kernel.org/qemu-devel/20260827161002.310688-1-den@openvz.org/
Signed-off-by: Denis V. Lunev <den@openvz.org>
Denis V. Lunev (5):
iotests: add coverage for NBD transmission commands #VSTOR-119829
nbd/server: accept NBD_CMD_CACHE above the maximum payload size
#VSTOR-119829
iotests/nbd-commands: exercise the simple and structured reply modes
#VSTOR-119829
iotests/nbd-commands: cover NBD_CMD_BLOCK_STATUS with a payload
#VSTOR-119829
iotests/nbd-commands: cover the command flags and sparse replies
#VSTOR-119829
nbd/server.c | 4 +-
tests/qemu-iotests/tests/nbd-commands | 244 ++++++++++++++++++++++
tests/qemu-iotests/tests/nbd-commands.out | 5 +
3 files changed, 250 insertions(+), 3 deletions(-)
create mode 100755 tests/qemu-iotests/tests/nbd-commands
create mode 100644 tests/qemu-iotests/tests/nbd-commands.out
--
2.53.0
next reply other threads:[~2026-08-31 15:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 15:25 Denis V. Lunev [this message]
2026-08-31 15:25 ` [PATCH hci-8.0 1/5] iotests: add coverage for NBD transmission commands #VSTOR-119829 Denis V. Lunev
2026-09-01 15:51 ` Andrey Drobyshev
2026-08-31 15:25 ` [PATCH hci-8.0 2/5] nbd/server: accept NBD_CMD_CACHE above the maximum payload size #VSTOR-119829 Denis V. Lunev
2026-08-31 15:25 ` [PATCH hci-8.0 3/5] iotests/nbd-commands: exercise the simple and structured reply modes #VSTOR-119829 Denis V. Lunev
2026-08-31 15:25 ` [PATCH hci-8.0 4/5] iotests/nbd-commands: cover NBD_CMD_BLOCK_STATUS with a payload #VSTOR-119829 Denis V. Lunev
2026-08-31 15:25 ` [PATCH hci-8.0 5/5] iotests/nbd-commands: cover the command flags and sparse replies #VSTOR-119829 Denis V. Lunev
2026-09-01 15:50 ` [QEMU HCI-8.0 PATCH 6/5] VZ: iotests/nbd-commands: do not depend on cluster allocation order #VSTOR-119829 Andrey Drobyshev
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=20260831152528.1350583-1-den@openvz.org \
--to=den@openvz.org \
--cc=andrey.drobyshev@virtuozzo.com \
--cc=svt-core@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.