qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] Is the use of bdrv_getlength() in handle_aiocb_write_zeroes


From: Markus Armbruster
Subject: [Qemu-block] Is the use of bdrv_getlength() in handle_aiocb_write_zeroes() kosher?
Date: Fri, 04 Aug 2017 14:16:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Denis, you added this in commit d50d822:

#ifdef CONFIG_FALLOCATE
    if (s->has_fallocate && aiocb->aio_offset >= bdrv_getlength(aiocb->bs)) {
        int ret = do_fallocate(s->fd, 0, aiocb->aio_offset, aiocb->aio_nbytes);
        if (ret == 0 || ret != -ENOTSUP) {
            return ret;
        }
        s->has_fallocate = false;
    }
#endif

bdrv_getlength() can fail.  Does it do the right thing then?  For what
it's worth, the comparison of its value is signed.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]