Skip to content
  • Kevin Wolf's avatar
    de0fbe64
    job: Use AIO_WAIT_WHILE() in job_finish_sync() · de0fbe64
    Kevin Wolf authored
    
    
    job_finish_sync() needs to release the AioContext lock of the job before
    calling aio_poll(). Otherwise, callbacks called by aio_poll() would
    possibly take the lock a second time and run into a deadlock with a
    nested AIO_WAIT_WHILE() call.
    
    Also, job_drain() without aio_poll() isn't necessarily enough to make
    progress on a job, it could depend on bottom halves to be executed.
    
    Combine both open-coded while loops into a single AIO_WAIT_WHILE() call
    that solves both of these problems.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarFam Zheng <famz@redhat.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    de0fbe64
    job: Use AIO_WAIT_WHILE() in job_finish_sync()
    Kevin Wolf authored
    
    
    job_finish_sync() needs to release the AioContext lock of the job before
    calling aio_poll(). Otherwise, callbacks called by aio_poll() would
    possibly take the lock a second time and run into a deadlock with a
    nested AIO_WAIT_WHILE() call.
    
    Also, job_drain() without aio_poll() isn't necessarily enough to make
    progress on a job, it could depend on bottom halves to be executed.
    
    Combine both open-coded while loops into a single AIO_WAIT_WHILE() call
    that solves both of these problems.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarFam Zheng <famz@redhat.com>
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
Loading