]> git.ipfire.org Git - thirdparty/qemu.git/commit
qcow2: Avoid COW during metadata preallocation
authorKevin Wolf <kwolf@redhat.com>
Mon, 15 Apr 2019 14:25:01 +0000 (16:25 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 17 Sep 2019 18:51:40 +0000 (13:51 -0500)
commit5669ef1e6c40298762fc1f0610d6fac2a9552648
treee7aabd561f9c6648e8ddb148a7e6c7718d3e6217
parent131b9a05705636086699df15d4a6d328bb2585e8
qcow2: Avoid COW during metadata preallocation

Limiting the allocation to INT_MAX bytes isn't particularly clever
because it means that the final cluster will be a partial cluster which
will be completed through a COW operation. This results in unnecessary
data read and write requests which lead to an unwanted non-sparse
filesystem block for metadata preallocation.

Align the maximum allocation size down to the cluster size to avoid this
situation.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit f29fbf7c6b1c9a84f6931c1c222716fbe073e6e4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2.c