Am 08.01.2020 um 18:49 hat Alberto Garcia geschrieben: > This replaces all remaining instances in the qcow2 code. > > Signed-off-by: Alberto Garcia <be...@igalia.com>
> diff --git a/block/qcow2.c b/block/qcow2.c > index e8ce966f7f..6427c75409 100644 > --- a/block/qcow2.c > +++ b/block/qcow2.c > @@ -2175,7 +2175,7 @@ static coroutine_fn int > qcow2_co_preadv_task(BlockDriverState *bs, > offset, bytes, qiov, qiov_offset); > > case QCOW2_CLUSTER_NORMAL: > - if ((file_cluster_offset & 511) != 0) { > + if ((file_cluster_offset % BDRV_SECTOR_SIZE) != 0) { > return -EIO; > } Hm, unrelated to your change, but why do we test for 512 byte alignment here? file_cluster_offset should certainly be cluster aligned for normal clusters. And if the check fails, that's actually an image corruption and not just an I/O error. Am I missing something? Kevin