qcow2: Use bs->bl.request_alignment when updating an L1 entry
commitda86f8cbad30ed3819ee5fd19a3b19291459c768
authorAlberto Garcia <berto@igalia.com>
Sat, 18 Jan 2020 19:09:28 +0000 (18 20:09 +0100)
committerMax Reitz <mreitz@redhat.com>
Thu, 6 Feb 2020 12:47:45 +0000 (6 13:47 +0100)
tree71a7653adeace6604f887980e85b2ac359d92f08
parent344ffea951aa4aa4259f24c885ba00e768083f09
qcow2: Use bs->bl.request_alignment when updating an L1 entry

When updating an L1 entry the qcow2 driver writes a (512-byte) sector
worth of data to avoid a read-modify-write cycle. Instead of always
writing 512 bytes we should follow the alignment requirements of the
storage backend.

(the only exception is when the alignment is larger than the cluster
size because then we could be overwriting data after the L1 table)

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: 71f34d4ae4b367b32fb36134acbf4f4f7ee681f4.1579374329.git.berto@igalia.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2-cluster.c