[Libguestfs] [libnbd PATCH v2 0/5] Avoid deadlock with in-flight commands

Eric Blake eblake at redhat.com
Wed May 22 03:15:47 UTC 2019


On v1, we discussed whether cmds_to_issue needed to be a list, since
it never had more than one element. I played with the idea of making
it a list, and allowing the client to queue up new commands regardless
of whether the state machine is currently in READY. I also polished up
the tmp demo into a bit more full-fledged example file, worth
including since it also let me discover a hard-to-hit race with large
NBD_CMD_WRITE vs. EAGAIN failures (now fixed).

Eric Blake (5):
  lib: Refactor state event into command_common
  commands: Allow for a command queue
  states: Split ISSUE_COMMAND.SEND_REQUEST
  states: Allow in-flight read while writing next command
  examples: Add example to demonstrate just-fixed deadlock scenario

 .gitignore                       |   1 +
 examples/Makefile.am             |  10 ++
 examples/batched-read-write.c    | 199 +++++++++++++++++++++++++++++++
 generator/generator              |  40 +++++--
 generator/states-issue-command.c |  68 ++++++++---
 generator/states.c               |   6 +
 lib/disconnect.c                 |  17 +--
 lib/internal.h                   |  10 ++
 lib/rw.c                         |  41 ++++---
 9 files changed, 334 insertions(+), 58 deletions(-)
 create mode 100644 examples/batched-read-write.c

-- 
2.20.1




More information about the Libguestfs mailing list