qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-8.0] aio-posix: fix race between epoll upgrade and aio_se


From: Paolo Bonzini
Subject: Re: [PATCH for-8.0] aio-posix: fix race between epoll upgrade and aio_set_fd_handler()
Date: Thu, 23 Mar 2023 06:02:36 +0100



Il mer 22 mar 2023, 15:55 Stefan Hajnoczi <stefanha@redhat.com> ha scritto:
+    /* The list must not change while we add fds to epoll */
+    if (!qemu_lockcnt_dec_if_lock(&ctx->list_lock)) {
+        return false;
+    }
+
+    ok = fdmon_epoll_try_enable(ctx);
+
+    qemu_lockcnt_unlock(&ctx->list_lock);

Shouldn't this be inc_and_unlock to balance the change made by dec_if_lock?

Paolo

+
+    if (!ok) {
+        fdmon_epoll_disable(ctx);
+    }
+    return ok;
 }

 void fdmon_epoll_setup(AioContext *ctx)
--
2.39.2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]