From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:40705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB44S-0001Hz-MC for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:02:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB44Q-0003Km-Mo for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:02:20 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54694) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB44M-0003CH-St for qemu-devel@nongnu.org; Mon, 01 Apr 2019 17:02:16 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31Krcdf050795 for ; Mon, 1 Apr 2019 17:02:01 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rkqrc06uw-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Apr 2019 17:01:57 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Apr 2019 22:01:55 +0100 From: Michael Roth Date: Mon, 1 Apr 2019 15:59:00 -0500 In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> References: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com> Message-Id: <20190401210011.16009-27-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 26/97] block: for jobs, do not clear user_paused until after the resume List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Jeff Cody 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: Michael Roth --- job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/job.c b/job.c index fa671b431a..e36ebaafd8 100644 --- a/job.c +++ b/job.c @@ -732,10 +732,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--; } -- 2.17.1