Re: [PATCH] qcow2: Fix preallocation on images with unaligned sizes

2020-06-16 Thread Max Reitz
On 10.06.20 11:46, Alberto Garcia wrote: > When resizing an image with qcow2_co_truncate() using the falloc or > full preallocation modes the code assumes that both the old and new > sizes are cluster-aligned. > > There are two problems with this: > > 1) The calculation of how many clusters are

Re: [PATCH] qcow2: Fix preallocation on images with unaligned sizes

2020-06-10 Thread Eric Blake
On 6/10/20 4:46 AM, Alberto Garcia wrote: When resizing an image with qcow2_co_truncate() using the falloc or full preallocation modes the code assumes that both the old and new sizes are cluster-aligned. There are two problems with this: 1) The calculation of how many clusters are involved

[PATCH] qcow2: Fix preallocation on images with unaligned sizes

2020-06-10 Thread Alberto Garcia
When resizing an image with qcow2_co_truncate() using the falloc or full preallocation modes the code assumes that both the old and new sizes are cluster-aligned. There are two problems with this: 1) The calculation of how many clusters are involved does not always get the right result.