Skip to content
Snippets Groups Projects
Commit c7e9df3b authored by Kevin Wolf's avatar Kevin Wolf
Browse files

qcow2: Fix order in L2 table COW


When copying L2 tables (this happens only with internal snapshots), the order
wasn't completely safe, so that after a crash you could end up with a L2 table
that has too low refcount, possibly leading to corruption in the long run.

This patch puts the operations in the right order: First allocate the new
L2 table and replace the reference, and only then decrease the refcount of the
old table.

Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
(cherry picked from commit 16fde5f2)
parent 038a866f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment