Commit effecce6 authored by Kevin Wolf's avatar Kevin Wolf
Browse files

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.

Fixes: 738301e1
Reported-by: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
parent 6b9d62c2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1502,12 +1502,12 @@ static ssize_t handle_aiocb_write_zeroes_block(RawPosixAIOData *aiocb)
        } while (errno == EINTR);

        ret = translate_err(-errno);
    }
#endif

        if (ret == -ENOTSUP) {
            s->has_write_zeroes = false;
        }
    }
#endif

    return ret;
}