commit: Make base read-only if there is an early failure
PATCH 1/1 commit: Make base read-only if there is an early failure
You can reproduce this by passing an invalid filter-node-name (like "1234") to block-commit. In this case the base image is put in read-write mode but is never reset back to read-only.
--- block/commit.c | 3 +++ 1 file changed, 3 insertions(+)
block/commit.c +3 -0
@@ -384,6 +384,9 @@ fail:if (s->top) {blk_unref (s->top); } +if (s->base_read_only) { +bdrv_reopen_set_read_only (base, true,NULL ); + }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. */
Signature · 1 line
2.11.0
Quoted 4 lines · Alberto Garcia
You can reproduce this by passing an invalid filter-node-name (like "1234") to block-commit. In this case the base image is put in read-write mode but is never reset back to read-only.
Is it worth iotest coverage?
Quoted 20 lines
Signed-off-by Alberto Garcia <[email protected]>--- block/commit.c | 3 +++ 1 file changed, 3 insertions(+)block/commit.c +3
-0@@ -384,6 +384,9 @@ fail:if (s->top) {blk_unref (s->top); } +if (s->base_read_only) { +bdrv_reopen_set_read_only (base, true,NULL ); + }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. */
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Quoted 6 lines · Eric Blake
Quoted 3 lines · Alberto Garcia
You can reproduce this by passing an invalid filter-node-name (like "1234") to block-commit. In this case the base image is put in read-write mode but is never reset back to read-only.
Is it worth iotest coverage?
I couldn't think of any way to reproduce this that would trigger an error on an iotest, but I think I have one now, I'll try to write something.
Berto