Re: [Qemu-devel] [PATCH v2 1/2] block: posix: Always allocate the first block

2019-08-26 Thread Max Reitz
On 26.08.19 17:41, Nir Soffer wrote: > On Mon, Aug 26, 2019 at 3:31 PM Max Reitz wrote: >> >> On 26.08.19 00:03, Nir Soffer wrote: > ... >>> +/* >>> + * Help alignment probing by allocating the first block. >>> + * >>> + * When reading with direct I/O from unallocated area on Gluster backed by >>

Re: [Qemu-devel] [PATCH v2 1/2] block: posix: Always allocate the first block

2019-08-26 Thread Nir Soffer
On Mon, Aug 26, 2019 at 3:31 PM Max Reitz wrote: > > On 26.08.19 00:03, Nir Soffer wrote: ... > > +/* > > + * Help alignment probing by allocating the first block. > > + * > > + * When reading with direct I/O from unallocated area on Gluster backed by > > XFS, > > + * reading succeeds regardless

Re: [Qemu-devel] [PATCH v2 1/2] block: posix: Always allocate the first block

2019-08-26 Thread Nir Soffer
On Mon, Aug 26, 2019 at 4:49 PM Eric Blake wrote: > > On 8/26/19 7:31 AM, Max Reitz wrote: > > >> # the file size. This function hides the resulting difference in the > >> # stat -c '%b' output. > >> # Parameter 1: Number of blocks an empty file occupies > >> -# Parameter 2: Image size in byte

Re: [Qemu-devel] [PATCH v2 1/2] block: posix: Always allocate the first block

2019-08-26 Thread Nir Soffer
On Mon, Aug 26, 2019 at 4:46 PM Eric Blake wrote: > > On 8/25/19 5:03 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 usin

Re: [Qemu-devel] [PATCH v2 1/2] block: posix: Always allocate the first block

2019-08-26 Thread Eric Blake
On 8/26/19 7:31 AM, Max Reitz wrote: >> # the file size. This function hides the resulting difference in the >> # stat -c '%b' output. >> # Parameter 1: Number of blocks an empty file occupies >> -# Parameter 2: Image size in bytes >> +# Parameter 2: Minimal number of blocks in an image >> +#

Re: [Qemu-devel] [PATCH v2 1/2] block: posix: Always allocate the first block

2019-08-26 Thread Eric Blake
On 8/25/19 5:03 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, fooling

Re: [Qemu-devel] [PATCH v2 1/2] block: posix: Always allocate the first block

2019-08-26 Thread Max Reitz
On 26.08.19 00:03, 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

[Qemu-devel] [PATCH v2 1/2] block: posix: Always allocate the first block

2019-08-25 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 fallbac