All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] vhost: stick to -errno error return convention
@ 2021-11-11 15:33 Roman Kagan
  2021-11-11 15:33 ` [PATCH 01/10] vhost-user-blk: reconnect on any error during realize Roman Kagan
                   ` (12 more replies)
  0 siblings, 13 replies; 32+ messages in thread
From: Roman Kagan @ 2021-11-11 15:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, qemu-block, Michael S. Tsirkin, Raphael Norwitz,
	Hanna Reitz, yc-core, Marc-André Lureau, Paolo Bonzini

Error propagation between the generic vhost code and the specific backends is
not quite consistent: some places follow "return -1 and set errno" convention,
while others assume "return negated errno".  Furthermore, not enough care is
taken not to clobber errno.

As a result, on certain code paths the errno resulting from a failure may get
overridden by another function call, and then that zero errno inidicating
success is propagated up the stack, leading to failures being lost.  In
particular, we've seen errors in the communication with a vhost-user-blk slave
not trigger an immediate connection drop and reconnection, leaving it in a
broken state.

Rework error propagation to always return negated errno on errors and
correctly pass it up the stack.

Roman Kagan (10):
  vhost-user-blk: reconnect on any error during realize
  chardev/char-socket: tcp_chr_recv: don't clobber errno
  chardev/char-socket: tcp_chr_sync_read: don't clobber errno
  chardev/char-fe: don't allow EAGAIN from blocking read
  vhost-backend: avoid overflow on memslots_limit
  vhost-backend: stick to -errno error return convention
  vhost-vdpa: stick to -errno error return convention
  vhost-user: stick to -errno error return convention
  vhost: stick to -errno error return convention
  vhost-user-blk: propagate error return from generic vhost

 chardev/char-fe.c         |   7 +-
 chardev/char-socket.c     |  17 +-
 hw/block/vhost-user-blk.c |   4 +-
 hw/virtio/vhost-backend.c |   4 +-
 hw/virtio/vhost-user.c    | 401 +++++++++++++++++++++-----------------
 hw/virtio/vhost-vdpa.c    |  37 ++--
 hw/virtio/vhost.c         |  98 +++++-----
 7 files changed, 307 insertions(+), 261 deletions(-)

-- 
2.33.1



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

end of thread, other threads:[~2022-01-06 10:08 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 15:33 [PATCH 00/10] vhost: stick to -errno error return convention Roman Kagan
2021-11-11 15:33 ` [PATCH 01/10] vhost-user-blk: reconnect on any error during realize Roman Kagan
2021-11-11 17:52   ` Kevin Wolf
2021-11-12  7:39     ` Roman Kagan
2021-11-12 11:37       ` Kevin Wolf
2021-11-12 19:59         ` Roman Kagan
2021-11-29 22:15           ` Raphael Norwitz
2021-11-29 22:17   ` Raphael Norwitz
2021-11-11 15:33 ` [PATCH 02/10] chardev/char-socket: tcp_chr_recv: don't clobber errno Roman Kagan
2021-11-12  8:27   ` Marc-André Lureau
2021-11-11 15:33 ` [PATCH 03/10] chardev/char-socket: tcp_chr_sync_read: " Roman Kagan
2021-11-12  8:28   ` Marc-André Lureau
2021-11-11 15:33 ` [PATCH 04/10] chardev/char-fe: don't allow EAGAIN from blocking read Roman Kagan
2021-11-12  8:24   ` Marc-André Lureau
2021-11-12 19:04     ` Roman Kagan
2021-11-11 15:33 ` [PATCH 05/10] vhost-backend: avoid overflow on memslots_limit Roman Kagan
2021-11-11 17:59   ` Philippe Mathieu-Daudé
2021-11-12  7:46     ` Roman Kagan
2021-11-12  9:56       ` Daniel P. Berrangé
2021-11-12 11:10         ` Roman Kagan
2021-11-11 15:33 ` [PATCH 06/10] vhost-backend: stick to -errno error return convention Roman Kagan
2021-11-11 18:00   ` Philippe Mathieu-Daudé
2021-11-11 15:33 ` [PATCH 07/10] vhost-vdpa: " Roman Kagan
2021-11-11 15:33 ` [PATCH 08/10] vhost-user: " Roman Kagan
2021-11-11 15:33 ` [PATCH 09/10] vhost: " Roman Kagan
2021-11-11 15:33 ` [PATCH 10/10] vhost-user-blk: propagate error return from generic vhost Roman Kagan
2021-11-29 22:37   ` Raphael Norwitz
2021-11-11 20:14 ` [PATCH 00/10] vhost: stick to -errno error return convention Michael S. Tsirkin
2021-11-12  8:04   ` Roman Kagan
2021-11-28 21:47 ` Michael S. Tsirkin
2021-11-29 21:44   ` Roman Kagan
2022-01-06  9:57 ` Michael S. Tsirkin

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.