From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0Vbg-0005Hi-OE for qemu-devel@nongnu.org; Thu, 13 Sep 2018 13:40:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g0VbX-0001Nf-S7 for qemu-devel@nongnu.org; Thu, 13 Sep 2018 13:40:39 -0400 References: <20180913125217.23173-1-kwolf@redhat.com> <20180913125217.23173-2-kwolf@redhat.com> From: John Snow Message-ID: Date: Thu, 13 Sep 2018 13:38:47 -0400 MIME-Version: 1.0 In-Reply-To: <20180913125217.23173-2-kwolf@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 01/17] job: Fix missing locking due to mismerge List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: famz@redhat.com, slp@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, pbonzini@redhat.com On 09/13/2018 08:52 AM, Kevin Wolf wrote: > job_completed() had a problem with double locking that was recently > fixed independently by two different commits: > > "job: Fix nested aio_poll() hanging in job_txn_apply" > "jobs: add exit shim" > > One fix removed the first aio_context_acquire(), the other fix removed > the other one. Now we have a bug again and the code is run without any > locking. > > Add it back in one of the places. > > Signed-off-by: Kevin Wolf > --- > job.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/job.c b/job.c > index 82b46929bd..5c4e84f007 100644 > --- a/job.c > +++ b/job.c > @@ -847,7 +847,11 @@ static void job_completed(Job *job) > static void job_exit(void *opaque) > { > Job *job = (Job *)opaque; > + AioContext *ctx = job->aio_context; > + > + aio_context_acquire(ctx); > job_completed(job); > + aio_context_release(ctx); > } > > /** > OK =] Reviewed-by: John Snow