Browse Source

blockjob: Fix coroutine thread after AioContext change

Commit 463e0be10 ('blockjob: add AioContext attached callback') tried to
make block jobs robust against AioContext changes of their main node,
but it never made sure that the job coroutine actually runs in the new
thread.

Instead of waking up the job coroutine in whatever thread it ran before,
let's always pass the AioContext where it should be running now.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
master
Kevin Wolf 1 month ago
parent
commit
13726123ba
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      job.c

+ 1
- 1
job.c View File

@@ -432,7 +432,7 @@ void job_enter_cond(Job *job, bool(*fn)(Job *job))
432 432
     timer_del(&job->sleep_timer);
433 433
     job->busy = true;
434 434
     job_unlock();
435
-    aio_co_wake(job->co);
435
+    aio_co_enter(job->aio_context, job->co);
436 436
 }
437 437
 
438 438
 void job_enter(Job *job)

Loading…
Cancel
Save