• A
    file-posix: Handle `EINVAL` fallocate return value · bae127d4
    Antoine Damhet 提交于
    The `detect-zeroes=unmap` option may issue unaligned
    `FALLOC_FL_PUNCH_HOLE` requests, raw block devices can (and will) return
    `EINVAL`, qemu should then write the zeroes to the blockdev instead of
    issuing an `IO_ERROR`.
    
    The problem can be reprodced like this:
    
    $ qemu-io -c 'write -P 0 42 1234' --image-opts driver=host_device,filename=/dev/loop0,detect-zeroes=unmap
    write failed: Invalid argument
    Signed-off-by: NAntoine Damhet <antoine.damhet@blade-group.com>
    Message-Id: <20200717135603.51180-1-antoine.damhet@blade-group.com>
    Signed-off-by: NKevin Wolf <kwolf@redhat.com>
    bae127d4
file-posix.c 111.2 KB