[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v3 2/5] blkdebug: Add pass-through write_zero an
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v3 2/5] blkdebug: Add pass-through write_zero and discard support |
Date: |
Tue, 6 Dec 2016 23:00:36 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 |
On 02.12.2016 20:22, 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 <address@hidden>
>
> ---
> v3: rebase to byte-based read/write, improve docs on why no
> partial write zero passthrough
> v2: new patch
> ---
> block/blkdebug.c | 81
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 81 insertions(+)
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH v3 0/5] add blkdebug tests, Eric Blake, 2016/12/02
- [Qemu-block] [PATCH v3 1/5] blkdebug: Sanity check block layer guarantees, Eric Blake, 2016/12/02
- [Qemu-block] [PATCH v3 2/5] blkdebug: Add pass-through write_zero and discard support, Eric Blake, 2016/12/02
- Re: [Qemu-block] [PATCH v3 2/5] blkdebug: Add pass-through write_zero and discard support,
Max Reitz <=
- Re: [Qemu-block] [PATCH v3 2/5] blkdebug: Add pass-through write_zero and discard support, Eric Blake, 2016/12/06
- Re: [Qemu-block] [PATCH v3 2/5] blkdebug: Add pass-through write_zero and discard support, Max Reitz, 2016/12/06
- Re: [Qemu-block] [PATCH v3 2/5] blkdebug: Add pass-through write_zero and discard support, Eric Blake, 2016/12/06
- Re: [Qemu-block] [PATCH v3 2/5] blkdebug: Add pass-through write_zero and discard support, Max Reitz, 2016/12/06
- Re: [Qemu-block] [PATCH v3 2/5] blkdebug: Add pass-through write_zero and discard support, Eric Blake, 2016/12/06
Re: [Qemu-block] [PATCH v3 2/5] blkdebug: Add pass-through write_zero and discard support, Kevin Wolf, 2016/12/07
[Qemu-block] [PATCH v3 3/5] blkdebug: Simplify override logic, Eric Blake, 2016/12/02