file-posix: Fix has_write_zeroes after NO_FALLBACK
PATCH 1/1 file-posix: Fix has_write_zeroes after NO_FALLBACK
If QEMU_AIO_NO_FALLBACK is given, we always return failure and don't even try to use the BLKZEROOUT ioctl. In this failure case, we shouldn't disable has_write_zeroes because we didn't learn anything about the ioctl. The next request might not set QEMU_AIO_NO_FALLBACK and we can still use the ioctl then.
Reported-by Eric Blake <[email protected]>
Signed-off-by Kevin Wolf <[email protected]>
--- block/file-posix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
block/file-posix.c +3 -3
@@ -1555,12 +1555,12 @@ static ssize_t handle_aiocb_write_zeroes_block(RawPosixAIOData *aiocb) } while (errno == EINTR); ret =translate_err (-errno); +if (ret == -ENOTSUP ) { + s->has_write_zeroes = false; + } }#endif -if (ret == -ENOTSUP ) { - s->has_write_zeroes = false; - }return ret; }
Signature · 1 line
2.20.1
Quoted 6 lines · Kevin Wolf
If
QEMU_AIO_NO_FALLBACKis given, we always return failure and don't even try to use the BLKZEROOUT ioctl. In this failure case, we shouldn't disablehas_write_zeroesbecause we didn't learn anything about the ioctl. The next request might not setQEMU_AIO_NO_FALLBACKand we can still use the ioctl then.
Quoted 6 lines
Reported-by Eric Blake <[email protected]>Signed-off-by Kevin Wolf <[email protected]>--- block/file-posix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by Eric Blake <[email protected]>
Fixes 738301e1175
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org