提交 065abf9f 编写于 作者: A Alberto Garcia 提交者: Kevin Wolf

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.
Signed-off-by: NAlberto Garcia <berto@igalia.com>
Reviewed-by: NMax Reitz <mreitz@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 265a7e54
......@@ -383,6 +383,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. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册