On Wed, Jul 15, 2020 at 4:42 PM Kevin Wolf <[email protected]> wrote: > > Am 15.07.2020 um 15:22 hat Nir Soffer geschrieben: > > On Mon, Jul 13, 2020 at 7:56 PM Kevin Wolf <[email protected]> wrote: > > > > > > Am 13.07.2020 um 18:33 hat Nir Soffer geschrieben: > > > > On Fri, Jul 10, 2020 at 5:22 PM Kevin Wolf <[email protected]> wrote: > > > > > > > > > > Unaligned requests will automatically be aligned to > > > > > bl.request_alignment > > > > > and we don't want to extend requests to access space beyond the end of > > > > > the image, so it's required that the image size is aligned. > > > > > > > > > > With write requests, this could cause assertion failures like this if > > > > > RESIZE permissions weren't requested: > > > > > > > > > > qemu-img: block/io.c:1910: bdrv_co_write_req_prepare: Assertion > > > > > `end_sector <= bs->total_sectors || child->perm & BLK_PERM_RESIZE' > > > > > failed. > > > > > > > > > > This was e.g. triggered by qemu-img converting to a target image with > > > > > 4k > > > > > request alignment when the image was only aligned to 512 bytes, but > > > > > not > > > > > to 4k. > > > > > > > > Was it on NFS? Shouldn't this be fix by the next patch then? > > > > > > Patch 2 makes the problem go away for NFS because NFS doesn't even > > > require the 4k alignment. But on storage that legitimately needs 4k > > > alignment (or possibly other filesystems that are misdetected), you > > > would still hit the same problem. > > > > I want to add oVirt point of view on this. We enforce raw image > > alignment of 4k on file based storage, and 128m on block storage, so > > our raw images cannot have this issue. > > Yes, then you won't hit the problem. > > > We have an issue with empty qcow2 images which are unaligned size, but > > we don't create such images in normal flows. > > Can you give a reproducer where qcow2 images would be affected? > Generally speaking, the qcow2 driver either takes both WRITE and RESIZE > permissions or neither. So it should just automatically resize the image > as needed instead of crashing.
I think this is a theoretical issue in other programs trying to access the unaligned images using direct I/O.
