diff options
author | Sergio Lopez <slp@redhat.com> | 2021-06-02 08:05:52 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2021-06-02 14:23:20 +0200 |
commit | fd6afc501a019682d1b8468b562355a2887087bd (patch) | |
tree | 548361448666a9c9c5f774c06e875c7323b44536 /crypto/init.c | |
parent | 095cc4d0f62513d75e9bc1da37f08d9e97f267c4 (diff) |
nbd/server: Use drained block ops to quiesce the server
Before switching between AioContexts we need to make sure that we're
fully quiesced ("nb_requests == 0" for every client) when entering the
drained section.
To do this, we set "quiescing = true" for every client on
".drained_begin" to prevent new coroutines from being created, and
check if "nb_requests == 0" on ".drained_poll". Finally, once we're
exiting the drained section, on ".drained_end" we set "quiescing =
false" and call "nbd_client_receive_next_request()" to resume the
processing of new requests.
With these changes, "blk_aio_attach()" and "blk_aio_detach()" can be
reverted to be as simple as they were before f148ae7d36.
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1960137
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Sergio Lopez <slp@redhat.com>
Message-Id: <20210602060552.17433-3-slp@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'crypto/init.c')
0 files changed, 0 insertions, 0 deletions