]> git.ipfire.org Git - thirdparty/qemu.git/commit
block: Fix blk->in_flight during blk_wait_while_drained()
authorKevin Wolf <kwolf@redhat.com>
Tue, 7 Apr 2020 12:12:59 +0000 (14:12 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 7 Apr 2020 13:40:57 +0000 (15:40 +0200)
commit7f16476fab14fc32388e0ebae793f64673848efa
tree712f2616b235825d09dbb8e2df973e476db91c46
parentfbb92b6798894d3bf62fe3578d99fa62c720b242
block: Fix blk->in_flight during blk_wait_while_drained()

Waiting in blk_wait_while_drained() while blk->in_flight is increased
for the current request is wrong because it will cause the drain
operation to deadlock.

This patch makes sure that blk_wait_while_drained() is called with
blk->in_flight increased exactly once for the current request, and that
it temporarily decreases the counter while it waits.

Fixes: cf3129323f900ef5ddbccbe86e4fa801e88c566e
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200407121259.21350-4-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/block-backend.c