提交 cd14f4d3 编写于 作者: K Kevin Wolf 提交者: Aurelien Jarno

qcow2: Clear L2 table cache after write error

If the L2 table was already updated in cache, but writing it to disk has
failed, we must not continue using the changed version in the cache to stay
consistent with what's on the disk.
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
(cherry picked from commit 1b7c801b)

Conflicts:

	block/qcow2-cluster.c
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 df631629
......@@ -672,8 +672,9 @@ int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m)
(i << s->cluster_bits)) | QCOW_OFLAG_COPIED);
}
if (write_l2_entries(s, l2_table, l2_offset, l2_index, m->nb_clusters) < 0) {
ret = -1;
ret = write_l2_entries(s, l2_table, l2_offset, l2_index, m->nb_clusters);
if (ret < 0) {
qcow2_l2_cache_reset(bs);
goto err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册