nvme: correct locking around completion
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 14 Aug 2018 06:27:39 +0000 (08:27 +0200)
committerFam Zheng <famz@redhat.com>
Fri, 12 Oct 2018 01:46:14 +0000 (09:46 +0800)
nvme_poll_queues is already protected by q->lock, and
AIO callbacks are invoked outside the AioContext lock.
So remove the acquire/release pair in nvme_handle_event.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20180814062739.19640-1-pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
block/nvme.c

index 781d77d6d25cf80a053063beaab783978be14f4b..29294038fcc21ab9698311f793e8820b03baef7e 100644 (file)
@@ -489,10 +489,8 @@ static void nvme_handle_event(EventNotifier *n)
     BDRVNVMeState *s = container_of(n, BDRVNVMeState, irq_notifier);
 
     trace_nvme_handle_event(s);
-    aio_context_acquire(s->aio_context);
     event_notifier_test_and_clear(n);
     nvme_poll_queues(s);
-    aio_context_release(s->aio_context);
 }
 
 static bool nvme_add_io_queue(BlockDriverState *bs, Error **errp)