mbox series

[for-5.0,v3,0/3] block: Fix blk->in_flight during blk_wait_while_drained()

Message ID 20200407121259.21350-1-kwolf@redhat.com
Headers show
Series block: Fix blk->in_flight during blk_wait_while_drained() | expand

Message

Kevin Wolf April 7, 2020, 12:12 p.m. UTC
This fixes deadlocks when draining a BlockBackend in an iothread that
receives new requests at the same time.

v3:
- Call blk_inc/dec_in_flight() in blk_prw() rather than inside the
  coroutines [Max]

v2:
- Rework the whole thing so that direct callers of blk_co_*() aren't
  broken after the series [Max]

Kevin Wolf (3):
  block-backend: Reorder flush/pdiscard function definitions
  block: Increase BB.in_flight for coroutine and sync interfaces
  block: Fix blk->in_flight during blk_wait_while_drained()

 include/sysemu/block-backend.h |   1 -
 block/block-backend.c          | 206 ++++++++++++++++++++-------------
 2 files changed, 128 insertions(+), 79 deletions(-)