All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] nbd/client-connection: Fix client returning a closed channel
@ 2026-11-30 12:44 Guillaume Vincke
  2026-11-30 12:44 ` [PATCH v4 1/3] " Guillaume Vincke
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Guillaume Vincke @ 2026-11-30 12:44 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-block, Eric Blake, Vladimir Sementsov-Ogievskiy, Kevin Wolf,
	Hanna Reitz, Guillaume Vincke

Based-on: <20261130111327.178850-1-guillaume.vincke@ovhcloud.com>

NBD client relies on lazy reconnection on error. There is a case where
nbd_co_establish_connection() will hand back a channel disconnected by
its peer. This leads to the request running on the dead channel. When
reconnect-delay is set to 0 (the default), this bug prevents the
nbd-connect thread from running on the first operation. This patch set
addresses this specific case.

Found while searching for a way to force client reconnection to simplify
the resize of idle nodes which will be the subject of another patch set.

v1: https://patchew.org/QEMU/20260925155346.357703-1-guillaume.vincke@ovhcloud.com/
v2: https://patchew.org/QEMU/20261016084136.233836-1-guillaume.vincke@ovhcloud.com/
v3: https://patchew.org/QEMU/20261105164124.249395-1-guillaume.vincke@ovhcloud.com/

v1 -> v2:
- patch 1: Pick up Eric Blake's formatting changes.
- patch 2: Start the connect thread after the NBD server so the test no
longer depends on the 1s connect retry, which made v1 fail in CI. Raise
the connect wait to 1s.

v2 -> v3:
- patch 2: Restrict the test to qcow2. The luks CI failure was the
missing key-secret and the parallels failure was the dirty-image repair
message. Neither was timing.

v3 -> v4:
- patch 1: Add Eric Blake's Reviewed-by.
- patch 2 (new): Detect closed TLS channels. A server may send
  close_notify before closing, which the raw socket peek reads as data.
- patch 3: Wait for the connect thread to park with
  x-debug-query-nbd-client instead of sleeping. Add a TLS test with
  a minimal NBD server that sends close_notify.

Guillaume Vincke (3):
  nbd/client-connection: Fix client returning a closed channel
  nbd/client-connection: Fix client returning a closed TLS channel
  iotests: Add coverage for NBD connect thread start delay

 nbd/client-connection.c                       |  84 +++++++
 tests/qemu-iotests/tests/nbd-stale-connection |  70 ++++++
 .../tests/nbd-stale-connection.out            |  17 ++
 .../tests/nbd-stale-tls-connection            | 205 ++++++++++++++++++
 .../tests/nbd-stale-tls-connection.out        |  14 ++
 5 files changed, 390 insertions(+)
 create mode 100755 tests/qemu-iotests/tests/nbd-stale-connection
 create mode 100644 tests/qemu-iotests/tests/nbd-stale-connection.out
 create mode 100755 tests/qemu-iotests/tests/nbd-stale-tls-connection
 create mode 100644 tests/qemu-iotests/tests/nbd-stale-tls-connection.out

-- 
2.43.0



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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 12:44 [PATCH v4 0/3] nbd/client-connection: Fix client returning a closed channel Guillaume Vincke
2026-11-30 12:44 ` [PATCH v4 1/3] " Guillaume Vincke
2026-12-01 17:14   ` Daniel P. Berrangé
2026-11-30 12:44 ` [PATCH v4 2/3] nbd/client-connection: Fix client returning a closed TLS channel Guillaume Vincke
2026-12-01 16:23   ` Eric Blake
2026-11-30 12:44 ` [PATCH v4 3/3] iotests: Add coverage for NBD connect thread start delay Guillaume Vincke
2026-12-01 17:05   ` Eric Blake

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.