qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	"open list:Block layer core" <qemu-block@nongnu.org>,
	Fam Zheng <fam@euphon.net>, qemu-stable <qemu-stable@nongnu.org>,
	Qing Wang <qinwang@redhat.com>
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	[thread overview]
Message-ID: <20230323135819.GA1331422@fedora> (raw)
In-Reply-To: <CABgObfbxqDNjH_RWu8L4dU+f9VchZi-c-=nNpt5vCGfK7Asndg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 607 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2023-03-23 13:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22 14:55 [PATCH for-8.0] aio-posix: fix race between epoll upgrade and aio_set_fd_handler() Stefan Hajnoczi
2023-03-23  5:02 ` Paolo Bonzini
2023-03-23 13:58   ` Stefan Hajnoczi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230323135819.GA1331422@fedora \
    --to=stefanha@redhat.com \
    --cc=fam@euphon.net \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=qinwang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).