On 10/21/2016 08:14 AM, Ed Swierk wrote: > On Thu, Oct 20, 2016 at 6:38 PM, Eric Blake wrote: >> On 10/20/2016 07:24 PM, Ed Swierk wrote: >>> Changing max_transfer in the normal write case to >>> MIN_NON_ZERO(alignment, MAX_WRITE_ZEROES_BOUNCE_BUFFER) appears to fix >>> the problem, but I don't pretend to understand all the subtleties >>> here. >> >> That actually sounds like the right fix. But since the bug was probably >> caused by my code, I'll formalize it into a patch and see if I can >> modify the testsuite to give it coverage. > > If alignment > MAX_WRITE_ZEROES_BOUNCE_BUFFER (however unlikely) we > have the same problem, so maybe this would be better? Our qcow2 support is currently limited to a maximum of 2M clusters; while MAX_WRITE_ZEROES_BOUNCE_BUFFER is 32k * 512, or 16M. The maximum-size bounce buffer should not be the problem here; but for some reason, it looks like alignment is larger than max_transfer which should not normally be possible. I'm still playing with what should be the right patch, but hope to have something posted soon. > > max_transfer = alignment > 0 ? alignment : MAX_WRITE_ZEROES_BOUNCE_BUFFER > > --Ed > -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org