[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 01/61] commit: Fix completion with extra reference
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 01/61] commit: Fix completion with extra reference |
Date: |
Fri, 23 Jun 2017 18:20:59 +0200 |
commit_complete() can't assume that after its block_job_completed() the
job is actually immediately freed; someone else may still be holding
references. In this case, the op blockers on the intermediate nodes make
the graph reconfiguration in the completion code fail.
Call block_job_remove_all_bdrv() manually so that we know for sure that
any blockers on intermediate nodes are given up.
Cc: address@hidden
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
block/commit.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/block/commit.c b/block/commit.c
index af6fa68..8c09c3d 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -119,6 +119,13 @@ static void commit_complete(BlockJob *job, void *opaque)
}
g_free(s->backing_file_str);
blk_unref(s->top);
+
+ /* If there is more than one reference to the job (e.g. if called from
+ * block_job_finish_sync()), block_job_completed() won't free it and
+ * therefore the blockers on the intermediate nodes remain. This would
+ * cause bdrv_set_backing_hd() to fail. */
+ block_job_remove_all_bdrv(job);
+
block_job_completed(&s->common, ret);
g_free(data);
--
1.8.3.1
- [Qemu-block] [PULL 00/61] Block layer patches, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 01/61] commit: Fix completion with extra reference,
Kevin Wolf <=
- [Qemu-block] [PULL 02/61] qemu-iotests: Allow starting new qemu after cleanup, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 04/61] block: count bdrv_co_rw_vmstate() requests, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 03/61] qemu-iotests: Test exiting qemu with running job, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 05/61] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 06/61] migration: avoid recursive AioContext locking in save_vmstate(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 07/61] migration: use bdrv_drain_all_begin/end() instead bdrv_drain_all(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 10/61] throttle: Update throttle-groups.c documentation, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 09/61] doc: Document driver-specific -blockdev options, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 08/61] doc: Document generic -blockdev options, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 12/61] migration: hold AioContext lock for loadvm qemu_fclose(), Kevin Wolf, 2017/06/23