}
static bool child_job_drained_poll(BdrvChild *c)
@@ -111,8 +113,10 @@ static bool child_job_drained_poll(BdrvChild *c)
/* An inactive or completed job doesn't have any pending
requests. Jobs
* with !job->busy are either already paused or have a pause
point after
* being reentered, so no job driver code will run before they
pause. */
- if (!job->busy || job_is_completed(job)) {
- return false;
+ WITH_JOB_LOCK_GUARD() {
+ if (!job->busy || job_is_completed_locked(job)) {
+ return false;
+ }
}
This doesn't correspond to commit subject. I'd put such things to
separate commit "correct use of job_mutex in blockjob.c".
/* Otherwise, assume that it isn't fully stopped yet, but
allow the job to
@@ -127,7 +131,9 @@ static bool child_job_drained_poll(BdrvChild *c)
static void child_job_drained_end(BdrvChild *c, int
*drained_end_counter)
{
BlockJob *job = c->opaque;
- job_resume(&job->job);
+ WITH_JOB_LOCK_GUARD() {
+ job_resume_locked(&job->job);
+ }
}
Again, don't see a reason for such change.
[my comments relate to more similar cases in the patch]