Blame SOURCES/kvm-job-Fix-missing-locking-due-to-mismerge.patch

357786
From a3a6c860441cfaa684fe819791628f9d43af98dc Mon Sep 17 00:00:00 2001
357786
From: Kevin Wolf <kwolf@redhat.com>
357786
Date: Fri, 14 Sep 2018 10:55:24 +0200
357786
Subject: [PATCH 33/49] job: Fix missing locking due to mismerge
357786
357786
RH-Author: Kevin Wolf <kwolf@redhat.com>
357786
Message-id: <20180914105540.18077-27-kwolf@redhat.com>
357786
Patchwork-id: 82178
357786
O-Subject: [RHV-7.6 qemu-kvm-rhev PATCH 26/42] job: Fix missing locking due to mismerge
357786
Bugzilla: 1601212
357786
RH-Acked-by: John Snow <jsnow@redhat.com>
357786
RH-Acked-by: Max Reitz <mreitz@redhat.com>
357786
RH-Acked-by: Fam Zheng <famz@redhat.com>
357786
357786
job_completed() had a problem with double locking that was recently
357786
fixed independently by two different commits:
357786
357786
"job: Fix nested aio_poll() hanging in job_txn_apply"
357786
"jobs: add exit shim"
357786
357786
One fix removed the first aio_context_acquire(), the other fix removed
357786
the other one. Now we have a bug again and the code is run without any
357786
locking.
357786
357786
Add it back in one of the places.
357786
357786
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
357786
Reviewed-by: Max Reitz <mreitz@redhat.com>
357786
Reviewed-by: John Snow <jsnow@redhat.com>
357786
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
---
357786
 job.c | 4 ++++
357786
 1 file changed, 4 insertions(+)
357786
357786
diff --git a/job.c b/job.c
357786
index 5d117fb..db53163 100644
357786
--- a/job.c
357786
+++ b/job.c
357786
@@ -842,7 +842,11 @@ static void job_completed(Job *job)
357786
 static void job_exit(void *opaque)
357786
 {
357786
     Job *job = (Job *)opaque;
357786
+    AioContext *ctx = job->aio_context;
357786
+
357786
+    aio_context_acquire(ctx);
357786
     job_completed(job);
357786
+    aio_context_release(ctx);
357786
 }
357786
 
357786
 /**
357786
-- 
357786
1.8.3.1
357786