Antoine Damhet bae127d4dc file-posix: Handle EINVAL fallocate return value
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: Antoine Damhet <antoine.damhet@blade-group.com>
Message-Id: <20200717135603.51180-1-antoine.damhet@blade-group.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2020-07-21 16:28:57 +02:00
..
2019-10-10 10:56:17 +02:00
2020-05-18 19:05:25 +02:00
2020-05-18 19:05:25 +02:00
2020-05-18 19:05:25 +02:00
2020-05-18 19:05:25 +02:00
2020-07-06 10:34:14 +02:00
2020-07-17 14:20:57 +02:00
2020-06-23 15:46:08 +01:00
2020-05-05 13:17:36 +02:00
2020-07-14 15:18:59 +02:00
2020-07-06 10:34:14 +02:00
2020-07-17 14:20:57 +02:00
2020-07-14 15:18:59 +02:00