diff options
author | Fam Zheng <famz@redhat.com> | 2018-08-24 10:43:42 +0800 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-09-25 15:50:15 +0200 |
commit | 49880165a44f26dc84651858750facdee31f2513 (patch) | |
tree | 3618fd2603a21d63298456f8b1d679d7ed736560 /include/fpu | |
parent | 6808ae0417131f8dbe7b051256dff7a16634dc1d (diff) | |
download | qemu-49880165a44f26dc84651858750facdee31f2513.zip qemu-49880165a44f26dc84651858750facdee31f2513.tar.gz qemu-49880165a44f26dc84651858750facdee31f2513.tar.bz2 |
job: Fix nested aio_poll() hanging in job_txn_apply
All callers have acquired ctx already. Doing that again results in
aio_poll() hang. This fixes the problem that a BDRV_POLL_WHILE() in the
callback cannot make progress because ctx is recursively locked, for
example, when drive-backup finishes.
There are two callers of job_finalize():
fam@lemon:~/work/qemu [master]$ git grep -w -A1 '^\s*job_finalize'
blockdev.c: job_finalize(&job->job, errp);
blockdev.c- aio_context_release(aio_context);
--
job-qmp.c: job_finalize(job, errp);
job-qmp.c- aio_context_release(aio_context);
--
tests/test-blockjob.c: job_finalize(&job->job, &error_abort);
tests/test-blockjob.c- assert(job->job.status == JOB_STATUS_CONCLUDED);
Ignoring the test, it's easy to see both callers to job_finalize (and
job_do_finalize) have acquired the context.
Cc: qemu-stable@nongnu.org
Reported-by: Gu Nini <ngu@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/fpu')
0 files changed, 0 insertions, 0 deletions