qemu-stable
[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: Stefan Hajnoczi
Subject: Re: [PATCH for-8.0] aio-posix: fix race between epoll upgrade and aio_set_fd_handler()
Date: Thu, 23 Mar 2023 09:58:19 -0400

On Thu, Mar 23, 2023 at 06:02:36AM +0100, Paolo Bonzini wrote:
> 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?

Yes, the caller expects list_lock to still be incremented. Thanks for
catching this!

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

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