From: Max Reitz <mreitz@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v6 07/10] blkdebug: Add pass-through write_zero and discard support
Date: Mon, 13 Mar 2017 23:20:24 +0100 [thread overview]
Message-ID: <8d749d12-3d2e-c26f-8aa8-95e016173ed2@redhat.com> (raw)
In-Reply-To: <20170308025428.1037-8-eblake@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2249 bytes --]
On 08.03.2017 03:54, Eric Blake wrote:
> In order to test the effects of artificial geometry constraints
> on operations like write zero or discard, we first need blkdebug
> to manage these actions. It also allows us to inject errors on
> those operations, just like we can for read/write/flush.
>
> We can also test the contract promised by the block layer; namely,
> if a device has specified limits on alignment or maximum size,
> then those limits must be obeyed (for now, the blkdebug driver
> merely inherits limits from whatever it is wrapping, but the next
> patch will further enhance it to allow specific limit overrides).
>
> This patch intentionally refuses to service requests smaller than
> the requested alignments; this is because an upcoming patch adds
> a qemu-iotest to prove that the block layer is correctly handling
> fragmentation, but the test only works if there is a way to tell
> the difference at artificial alignment boundaries when blkdebug is
> using a larger-than-default alignment. If we let the blkdebug
> layer always defer to the underlying layer, which potentially has
> a smaller granularity, the iotest will be thwarted.
>
> Tested by setting up an NBD server with export 'foo', then invoking:
> $ ./qemu-io
> qemu-io> open -o driver=blkdebug blkdebug::nbd://localhost:10809/foo
> qemu-io> d 0 15M
> qemu-io> w -z 0 15M
>
> Pre-patch, the server never sees the discard (it was silently
> eaten by the block layer); post-patch it is passed across the
> wire. Likewise, pre-patch the write is always passed with
> NBD_WRITE (with 15M of zeroes on the wire), while post-patch
> it can utilize NBD_WRITE_ZEROES (for less traffic).
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
>
> ---
> v6: tighten check of unaligned requests, rebase on rule check
> refactoring, drop R-b
> v5: include 2017 copyright
> v4: correct error injection to respect byte range, tweak formatting
> v3: rebase to byte-based read/write, improve docs on why no
> partial write zero passthrough
> v2: new patch
> ---
> block/blkdebug.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 74 insertions(+)
Reviewed-by: Max Reitz <mreitz@redhat.com>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
next prev parent reply other threads:[~2017-03-13 22:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 2:54 [Qemu-devel] [PATCH v6 00/10] add blkdebug tests Eric Blake
2017-03-08 2:54 ` [Qemu-devel] [PATCH v6 01/10] iotests: fix 097 when run with qcow Eric Blake
2017-03-08 2:54 ` [Qemu-devel] [PATCH v6 02/10] iotests: Improve image-clear tests on non-aligned image Eric Blake
2017-03-13 22:00 ` Max Reitz
2017-03-30 2:13 ` Eric Blake
2017-03-30 18:39 ` Eric Blake
2017-03-30 21:25 ` Max Reitz
2017-03-08 2:54 ` [Qemu-devel] [PATCH v6 03/10] qcow2: Assert that cluster operations are aligned Eric Blake
2017-03-13 22:07 ` Max Reitz
2017-03-08 2:54 ` [Qemu-devel] [PATCH v6 04/10] qcow2: Discard/zero clusters by byte count Eric Blake
2017-03-08 2:54 ` [Qemu-devel] [PATCH v6 05/10] blkdebug: Sanity check block layer guarantees Eric Blake
2017-03-08 2:54 ` [Qemu-devel] [PATCH v6 06/10] blkdebug: Refactor error injection Eric Blake
2017-03-13 22:16 ` Max Reitz
2017-03-08 2:54 ` [Qemu-devel] [PATCH v6 07/10] blkdebug: Add pass-through write_zero and discard support Eric Blake
2017-03-13 22:20 ` Max Reitz [this message]
2017-03-08 2:54 ` [Qemu-devel] [PATCH v6 08/10] blkdebug: Simplify override logic Eric Blake
2017-03-08 2:54 ` [Qemu-devel] [PATCH v6 09/10] blkdebug: Add ability to override unmap geometries Eric Blake
2017-03-13 22:22 ` Max Reitz
2017-03-08 2:54 ` [Qemu-devel] [PATCH v6 10/10] tests: Add coverage for recent block geometry fixes Eric Blake
2017-03-08 8:40 ` [Qemu-devel] [PATCH v6 00/10] add blkdebug tests Kevin Wolf
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=8d749d12-3d2e-c26f-8aa8-95e016173ed2@redhat.com \
--to=mreitz@redhat.com \
--cc=eblake@redhat.com \
--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 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).