Blame SOURCES/kvm-block-for-jobs-do-not-clear-user_paused-until-after-.patch

1bdc94
From 9382be6ea4b3785bcc3a4868e1f69348157ba5b1 Mon Sep 17 00:00:00 2001
1bdc94
From: Jeffrey Cody <jcody@redhat.com>
1bdc94
Date: Tue, 28 Aug 2018 21:08:16 +0200
1bdc94
Subject: [PATCH 03/29] block: for jobs, do not clear user_paused until after
1bdc94
 the resume
1bdc94
1bdc94
RH-Author: Jeffrey Cody <jcody@redhat.com>
1bdc94
Message-id: <b7236ceff2905bca32576f0932fe569344ecbc5e.1535490170.git.jcody@redhat.com>
1bdc94
Patchwork-id: 81957
1bdc94
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 1/3] block: for jobs, do not clear user_paused until after the resume
1bdc94
Bugzilla: 1605026
1bdc94
RH-Acked-by: Max Reitz <mreitz@redhat.com>
1bdc94
RH-Acked-by: John Snow <jsnow@redhat.com>
1bdc94
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
1bdc94
1bdc94
The function job_cancel_async() will always cause an assert for blockjob
1bdc94
user resume.  We set job->user_paused to false, and then call
1bdc94
job->driver->user_resume().  In the case of blockjobs, this is the
1bdc94
block_job_user_resume() function.
1bdc94
1bdc94
In that function, we assert that job.user_paused is set to true.
1bdc94
Unfortunately, right before calling this function, it has explicitly
1bdc94
been set to false.
1bdc94
1bdc94
The fix is pretty simple: set job->user_paused to false only after the
1bdc94
job user_resume() function has been called.
1bdc94
1bdc94
Reviewed-by: John Snow <jsnow@redhat.com>
1bdc94
Reviewed-by: Eric Blake <eblake@redhat.com>
1bdc94
Signed-off-by: Jeff Cody <jcody@redhat.com>
1bdc94
Message-id: bb183b77d8f2dd6bd67b8da559a90ac1e74b2052.1534868459.git.jcody@redhat.com
1bdc94
Signed-off-by: Jeff Cody <jcody@redhat.com>
1bdc94
(cherry picked from commit e321c0597c7590499bacab239d7f86e257f96bcd)
1bdc94
Signed-off-by: Jeff Cody <jcody@redhat.com>
1bdc94
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
1bdc94
---
1bdc94
 job.c | 2 +-
1bdc94
 1 file changed, 1 insertion(+), 1 deletion(-)
1bdc94
1bdc94
diff --git a/job.c b/job.c
1bdc94
index 84e1402..95dc998 100644
1bdc94
--- a/job.c
1bdc94
+++ b/job.c
1bdc94
@@ -727,10 +727,10 @@ static void job_cancel_async(Job *job, bool force)
1bdc94
 {
1bdc94
     if (job->user_paused) {
1bdc94
         /* Do not call job_enter here, the caller will handle it.  */
1bdc94
-        job->user_paused = false;
1bdc94
         if (job->driver->user_resume) {
1bdc94
             job->driver->user_resume(job);
1bdc94
         }
1bdc94
+        job->user_paused = false;
1bdc94
         assert(job->pause_count > 0);
1bdc94
         job->pause_count--;
1bdc94
     }
1bdc94
-- 
1bdc94
1.8.3.1
1bdc94