[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 07/71] commit: Replace commit_top_bs on failure after
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 07/71] commit: Replace commit_top_bs on failure after deleting the block job |
Date: |
Mon, 25 Feb 2019 16:19:49 +0100 |
From: Alberto Garcia <address@hidden>
If there's an error in commit_start() then the block job must be
deleted before replacing commit_top_bs, otherwise it will fail because
of lack of permissions. This happens since the permission system was
introduced in 8dfba2797761d8a43744e4e6571c8175e448a478.
Fortunately this bug doesn't seem to be possible to reproduce at the
moment without changing the code.
Signed-off-by: Alberto Garcia <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/commit.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/commit.c b/block/commit.c
index 53148e610b..5deb05925b 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -374,10 +374,12 @@ fail:
if (s->top) {
blk_unref(s->top);
}
+ job_early_fail(&s->common.job);
+ /* commit_top_bs has to be replaced after deleting the block job,
+ * otherwise this would fail because of lack of permissions. */
if (commit_top_bs) {
bdrv_replace_node(commit_top_bs, top, &error_abort);
}
- job_early_fail(&s->common.job);
}
--
2.20.1
- [Qemu-block] [PULL 00/71] Block layer patches, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 01/71] MAINTAINERS: Replace myself with John Snow for block jobs, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 02/71] MAINTAINERS: Remove myself as block maintainer, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 03/71] block/snapshot.c: eliminate use of ID input in snapshot operations, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 04/71] block/snapshot: remove bdrv_snapshot_delete_by_id_or_name, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 05/71] qcow2-snapshot: remove redundant find_snapshot_by_id_and_name call, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 07/71] commit: Replace commit_top_bs on failure after deleting the block job,
Kevin Wolf <=
- [Qemu-block] [PULL 06/71] block: don't set the same context, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 08/71] qemu-img: fix error reporting for -object, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 09/71] block-backend: Make blk_inc/dec_in_flight public, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 10/71] virtio-blk: Increase in_flight for request restart BH, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 11/71] nbd: Restrict connection_co reentrance, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 12/71] io: Make qio_channel_yield() interruptible, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 13/71] io: Remove redundant read/write_coroutine assignments, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 14/71] nbd: Move nbd_read_eof() to nbd/client.c, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 18/71] block: Fix AioContext switch for drained node, Kevin Wolf, 2019/02/25
- [Qemu-block] [PULL 20/71] block: Use normal drain for bdrv_set_aio_context(), Kevin Wolf, 2019/02/25