]> Git Repo - qemu.git/commitdiff
block/nfs: tear down aio before nfs_close
authorPeter Lieven <[email protected]>
Tue, 10 Sep 2019 15:41:09 +0000 (17:41 +0200)
committerKevin Wolf <[email protected]>
Fri, 13 Sep 2019 10:18:14 +0000 (12:18 +0200)
nfs_close is a sync call from libnfs and has its own event
handler polling on the nfs FD. Avoid that both QEMU and libnfs
are intefering here.

CC: [email protected]
Signed-off-by: Peter Lieven <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block/nfs.c

index 0ec50953e464bb4f6f4e30c24e864409e8e3fc00..2c985082757978be282999784c0976e92df94971 100644 (file)
@@ -390,12 +390,14 @@ static void nfs_attach_aio_context(BlockDriverState *bs,
 static void nfs_client_close(NFSClient *client)
 {
     if (client->context) {
+        qemu_mutex_lock(&client->mutex);
+        aio_set_fd_handler(client->aio_context, nfs_get_fd(client->context),
+                           false, NULL, NULL, NULL, NULL);
+        qemu_mutex_unlock(&client->mutex);
         if (client->fh) {
             nfs_close(client->context, client->fh);
             client->fh = NULL;
         }
-        aio_set_fd_handler(client->aio_context, nfs_get_fd(client->context),
-                           false, NULL, NULL, NULL, NULL);
         nfs_destroy_context(client->context);
         client->context = NULL;
     }
This page took 0.02644 seconds and 4 git commands to generate.