Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-25 Thread Maxim Levitsky
On Sun, 2019-08-25 at 22:51 +0300, Nir Soffer wrote: > On Sun, Aug 25, 2019 at 10:44 AM Maxim Levitsky wrote: > > On Sat, 2019-08-17 at 00:21 +0300, Nir Soffer wrote: > > > When creating an image with preallocation "off" or "falloc", the first > > > block of the image is typically not allocated.

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-25 Thread Nir Soffer
On Sun, Aug 25, 2019 at 10:44 AM Maxim Levitsky wrote: > On Sat, 2019-08-17 at 00:21 +0300, Nir Soffer wrote: > > When creating an image with preallocation "off" or "falloc", the first > > block of the image is typically not allocated. When using Gluster > > storage backed by XFS filesystem,

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-25 Thread Maxim Levitsky
On Sat, 2019-08-17 at 00:21 +0300, Nir Soffer wrote: > When creating an image with preallocation "off" or "falloc", the first > block of the image is typically not allocated. When using Gluster > storage backed by XFS filesystem, reading this block using direct I/O > succeeds regardless of request

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-24 Thread Nir Soffer
On Fri, Aug 23, 2019 at 8:53 PM Max Reitz wrote: > On 23.08.19 18:48, Nir Soffer wrote: > > On Fri, Aug 23, 2019 at 4:58 PM Max Reitz > > wrote: > > [...] > > > If you have a format layer that truncates the image to a fixed size > and > > does not write

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-23 Thread Max Reitz
On 23.08.19 18:48, Nir Soffer wrote: > On Fri, Aug 23, 2019 at 4:58 PM Max Reitz > wrote: [...] > If you have a format layer that truncates the image to a fixed size and > does not write anything into the first block itself (say because it uses > a footer),

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-23 Thread Max Reitz
On 23.08.19 18:30, Nir Soffer wrote: > On Fri, Aug 23, 2019 at 4:58 PM Max Reitz > wrote: > [...] > Exactly.  But if posix_fallocate() works, it should have allocated the > first block. > > > Only if the file system does not support fallocate().

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-23 Thread Nir Soffer
On Fri, Aug 23, 2019 at 4:58 PM Max Reitz wrote: > On 22.08.19 21:01, Nir Soffer wrote: > > On Thu, Aug 22, 2019 at 9:11 PM Max Reitz > > wrote: > > > > On 22.08.19 18:39, Nir Soffer wrote: > > > On Thu, Aug 22, 2019 at 5:28 PM Max Reitz >

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-23 Thread Nir Soffer
On Fri, Aug 23, 2019 at 4:58 PM Max Reitz wrote: > On 22.08.19 21:01, Nir Soffer wrote: > ... > > > > @@ -1794,6 +1815,8 @@ static int handle_aiocb_truncate(void > > *opaque) > > > > /* posix_fallocate() doesn't set errno. */ > > > >

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-23 Thread Max Reitz
On 22.08.19 21:01, Nir Soffer wrote: > On Thu, Aug 22, 2019 at 9:11 PM Max Reitz > wrote: > > On 22.08.19 18:39, Nir Soffer wrote: > > On Thu, Aug 22, 2019 at 5:28 PM Max Reitz > >

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-22 Thread Nir Soffer
On Thu, Aug 22, 2019 at 9:11 PM Max Reitz wrote: > On 22.08.19 18:39, Nir Soffer wrote: > > On Thu, Aug 22, 2019 at 5:28 PM Max Reitz > > wrote: > > > > On 16.08.19 23:21, Nir Soffer wrote: > > > When creating an image with preallocation "off" or "falloc", the

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-22 Thread Max Reitz
On 22.08.19 18:39, Nir Soffer wrote: > On Thu, Aug 22, 2019 at 5:28 PM Max Reitz > wrote: > > On 16.08.19 23:21, Nir Soffer wrote: > > When creating an image with preallocation "off" or "falloc", the first > > block of the image is typically not allocated.

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-22 Thread Nir Soffer
On Thu, Aug 22, 2019 at 5:28 PM Max Reitz wrote: > On 16.08.19 23:21, Nir Soffer wrote: > > When creating an image with preallocation "off" or "falloc", the first > > block of the image is typically not allocated. When using Gluster > > storage backed by XFS filesystem, reading this block using

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-22 Thread Max Reitz
On 16.08.19 23:21, Nir Soffer wrote: > When creating an image with preallocation "off" or "falloc", the first > block of the image is typically not allocated. When using Gluster > storage backed by XFS filesystem, reading this block using direct I/O > succeeds regardless of request length, fooling

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-22 Thread Nir Soffer
Max, did you have time to look at this? On Sat, Aug 17, 2019 at 12:21 AM Nir Soffer wrote: > When creating an image with preallocation "off" or "falloc", the first > block of the image is typically not allocated. When using Gluster > storage backed by XFS filesystem, reading this block using

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-16 Thread John Snow
On 8/16/19 6:45 PM, Nir Soffer wrote: > On Sat, Aug 17, 2019 at 12:57 AM John Snow > wrote: > > On 8/16/19 5:21 PM, Nir Soffer wrote: > > When creating an image with preallocation "off" or "falloc", the first > > block of the image is typically not

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-16 Thread Nir Soffer
On Sat, Aug 17, 2019 at 12:57 AM John Snow wrote: > On 8/16/19 5:21 PM, Nir Soffer wrote: > > When creating an image with preallocation "off" or "falloc", the first > > block of the image is typically not allocated. When using Gluster > > storage backed by XFS filesystem, reading this block

Re: [Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-16 Thread John Snow
On 8/16/19 5:21 PM, Nir Soffer wrote: > When creating an image with preallocation "off" or "falloc", the first > block of the image is typically not allocated. When using Gluster > storage backed by XFS filesystem, reading this block using direct I/O > succeeds regardless of request length,

[Qemu-block] [PATCH] block: posix: Always allocate the first block

2019-08-16 Thread Nir Soffer
When creating an image with preallocation "off" or "falloc", the first block of the image is typically not allocated. When using Gluster storage backed by XFS filesystem, reading this block using direct I/O succeeds regardless of request length, fooling alignment detection. In this case we