[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH v3 1/2] block: for jobs, do not clear user_paused u
From: |
Jeff Cody |
Subject: |
[Qemu-stable] [PATCH v3 1/2] block: for jobs, do not clear user_paused until after the resume |
Date: |
Tue, 21 Aug 2018 12:26:19 -0400 |
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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Jeff Cody <address@hidden>
---
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
- [Qemu-stable] [PATCH v3 0/2] block: for jobs, do not clear user_paused until after the resume, Jeff Cody, 2018/08/21
- [Qemu-stable] [PATCH v3 1/2] block: for jobs, do not clear user_paused until after the resume,
Jeff Cody <=
- [Qemu-stable] [PATCH v3 2/2] block: iotest to catch abort on forced blockjob cancel, Jeff Cody, 2018/08/21
- Re: [Qemu-stable] [Qemu-devel] [PATCH v3 0/2] block: for jobs, do not clear user_paused until after the resume, John Snow, 2018/08/21
- Re: [Qemu-stable] [PATCH v3 0/2] block: for jobs, do not clear user_paused until after the resume, Jeff Cody, 2018/08/21