From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com,
qemu-stable@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] nbd: Don't trim unrequested bytes
Date: Wed, 25 May 2016 14:33:35 +0200 [thread overview]
Message-ID: <20160525123335.GE4815@noname.redhat.com> (raw)
In-Reply-To: <57458BC3.6000606@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1059 bytes --]
Am 25.05.2016 um 13:25 hat Eric Blake geschrieben:
> On 05/25/2016 04:59 AM, Eric Blake wrote:
> > + /* Ignore unaligned head or tail, until block layer adds byte
> > + * interface */
> > + if (request.len >= BDRV_SECTOR_SIZE) {
> > + request.len -= (request.from + request.len) % BDRV_SECTOR_SIZE;
> > + ret = blk_co_discard(exp->blk,
> > + DIV_ROUND_UP(request.from + exp->dev_offset,
> > + BDRV_SECTOR_SIZE),
> > + request.len / BDRV_SECTOR_SIZE);
>
> This can end up calling blk_co_discard(, , 0) - do we need to audit
> whether all underlying drivers handle a 0-length request, and/or
> special-case this in blk_co_discard() to be an explicit no-op?
Auditing shouldn't be too hard as we don't have many drivers that
support the operation in the first place. In any case, it might be
useful to add a qemu-iotest case that tries all kinds of operations with
a zero length.
Kevin
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2016-05-25 12:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 10:59 [Qemu-devel] [PATCH v2] nbd: Don't trim unrequested bytes Eric Blake
2016-05-25 11:25 ` Eric Blake
2016-05-25 12:33 ` Kevin Wolf [this message]
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=20160525123335.GE4815@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=eblake@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).