qcow2: Restore L1 entry on l2_allocate failure
If writing the L1 table to disk failed, we need to restore its old content in
memory to avoid inconsistencies.
Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 68dba0bf45
)
This commit is contained in:
parent
6fd82592ce
commit
dfe0bb55ee
|
@ -266,6 +266,7 @@ static uint64_t *l2_allocate(BlockDriverState *bs, int l1_index)
|
|||
return l2_table;
|
||||
|
||||
fail:
|
||||
s->l1_table[l1_index] = old_l2_offset;
|
||||
qcow2_l2_cache_reset(bs);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue