From e582296e39bcca12dbfb267b3ffc511f3f64c242 Mon Sep 17 00:00:00 2001 From: John Snow Date: Wed, 10 Oct 2018 20:50:58 +0100 Subject: [PATCH 1/3] block: for jobs, do not clear user_paused until after the resume RH-Author: John Snow Message-id: <20181010205100.17689-2-jsnow@redhat.com> Patchwork-id: 82631 O-Subject: [RHEL8/rhel qemu-kvm PATCH 1/3] block: for jobs, do not clear user_paused until after the resume Bugzilla: 1635583 RH-Acked-by: Stefan Hajnoczi RH-Acked-by: Max Reitz RH-Acked-by: Kevin Wolf From: Jeff Cody The function job_cancel_async() will always cause an assert for blockjob user resume. We set job->user_paused to false, and then call job->driver->user_resume(). In the case of blockjobs, this is the block_job_user_resume() function. In that function, we assert that job.user_paused is set to true. Unfortunately, right before calling this function, it has explicitly been set to false. The fix is pretty simple: set job->user_paused to false only after the job user_resume() function has been called. Reviewed-by: John Snow Reviewed-by: Eric Blake Signed-off-by: Jeff Cody Message-id: bb183b77d8f2dd6bd67b8da559a90ac1e74b2052.1534868459.git.jcody@redhat.com Signed-off-by: Jeff Cody (cherry picked from commit e321c0597c7590499bacab239d7f86e257f96bcd) Signed-off-by: John Snow Signed-off-by: Danilo C. L. de Paula --- job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/job.c b/job.c index 3ab8ce1..dfba4bc 100644 --- a/job.c +++ b/job.c @@ -700,10 +700,10 @@ static void job_cancel_async(Job *job, bool force) { if (job->user_paused) { /* Do not call job_enter here, the caller will handle it. */ - job->user_paused = false; if (job->driver->user_resume) { job->driver->user_resume(job); } + job->user_paused = false; assert(job->pause_count > 0); job->pause_count--; } -- 1.8.3.1