From: Markus Armbruster <armbru@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
Kevin Wolf <kwolf@redhat.com>
Subject: [Qemu-devel] Is the use of bdrv_getlength() in handle_aiocb_write_zeroes() kosher?
Date: Fri, 04 Aug 2017 14:16:41 +0200 [thread overview]
Message-ID: <8760e3mst2.fsf@dusky.pond.sub.org> (raw)
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.
next reply other threads:[~2017-08-04 13:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 12:16 Markus Armbruster [this message]
2017-08-04 12:31 ` [Qemu-devel] Is the use of bdrv_getlength() in parallels.c kosher? (was: Is the use of bdrv_getlength() in handle_aiocb_write_zeroes() kosher?) Markus Armbruster
2017-08-04 13:10 ` [Qemu-devel] Is the use of bdrv_getlength() in parallels.c kosher? Denis V. Lunev
2017-08-04 13:08 ` [Qemu-devel] Is the use of bdrv_getlength() in handle_aiocb_write_zeroes() kosher? Denis V. Lunev
2017-08-04 14:20 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8760e3mst2.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=den@openvz.org \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.