aboutsummaryrefslogtreecommitdiff
path: root/nbd
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-12-01 23:49:57 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2023-04-20 11:17:36 +0200
commitdd5b6780f78bcbfc2120d879b092a8380d8bc706 (patch)
treeb69b69ce17768eda100e3e09959fc17bb306a260 /nbd
parent000eebcfe8824aa35face1d06b0fa3ab3ec2aea8 (diff)
nbd: a BlockExport always has a BlockBackend
exp->common.blk cannot be NULL, nbd_export_delete() is only called (through a bottom half) from blk_exp_unref() and in turn that can only happen after blk_exp_add() has asserted exp->blk != NULL. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'nbd')
-rw-r--r--nbd/server.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/nbd/server.c b/nbd/server.c
index 3d8d0d81df..4f5c42f84d 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -1847,15 +1847,13 @@ static void nbd_export_delete(BlockExport *blk_exp)
g_free(exp->description);
exp->description = NULL;
- if (exp->common.blk) {
- if (exp->eject_notifier_blk) {
- notifier_remove(&exp->eject_notifier);
- blk_unref(exp->eject_notifier_blk);
- }
- blk_remove_aio_context_notifier(exp->common.blk, blk_aio_attached,
- blk_aio_detach, exp);
- blk_set_disable_request_queuing(exp->common.blk, false);
+ if (exp->eject_notifier_blk) {
+ notifier_remove(&exp->eject_notifier);
+ blk_unref(exp->eject_notifier_blk);
}
+ blk_remove_aio_context_notifier(exp->common.blk, blk_aio_attached,
+ blk_aio_detach, exp);
+ blk_set_disable_request_queuing(exp->common.blk, false);
for (i = 0; i < exp->nr_export_bitmaps; i++) {
bdrv_dirty_bitmap_set_busy(exp->export_bitmaps[i], false);