[Qemu-devel] [PATCH 24/27] file-posix: Fix no-op bdrv_truncate() with falloc preallocation

2018-02-08 Thread Kevin Wolf
If bdrv_truncate() is called, but the requested size is the same as before, don't call posix_fallocate(), which returns -EINVAL for length zero and would therefore make bdrv_truncate() fail. The problem can be triggered by creating a zero-sized raw image with 'falloc' preallocation mode. Signed-o

Re: [Qemu-devel] [PATCH 24/27] file-posix: Fix no-op bdrv_truncate() with falloc preallocation

2018-02-12 Thread Max Reitz
On 2018-02-08 20:23, Kevin Wolf wrote: > If bdrv_truncate() is called, but the requested size is the same as > before, don't call posix_fallocate(), which returns -EINVAL for length > zero and would therefore make bdrv_truncate() fail. > > The problem can be triggered by creating a zero-sized raw