Virtuozzo QEMU development (svt-core@virtuozzo.com)
 help / color / mirror / Atom feed
* [PATCH hci-8.0 0/5] nbd/server: accept a large NBD_CMD_CACHE #VSTOR-119829
@ 2026-08-31 15:25 Denis V. Lunev
  2026-08-31 15:25 ` [PATCH hci-8.0 1/5] iotests: add coverage for NBD transmission commands #VSTOR-119829 Denis V. Lunev
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Denis V. Lunev @ 2026-08-31 15:25 UTC (permalink / raw)
  To: svt-core; +Cc: andrey.drobyshev, den

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-09-01 15:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-31 15:25 [PATCH hci-8.0 0/5] nbd/server: accept a large NBD_CMD_CACHE #VSTOR-119829 Denis V. Lunev
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox