[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [PATCH v4 3/8] mirror: Do zero write on target if sect
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-stable] [PATCH v4 3/8] mirror: Do zero write on target if sectors not allocated |
Date: |
Mon, 25 May 2015 16:38:28 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 22/05/2015 22:20, Eric Blake wrote:
> But I'm worried about a shallow copy. If I start with "base <-
> active", where "active" has an explicit zero cluster that is
> overwriting an allocated non-zero cluster in "base", and I'm
> creating the shallow clone to "base <- copy", then the default of
> 'unmap=true' says that bdrv_aio_write_zeroes() may attempt to unmap
> the cluster in "copy". At which point, doesn't that mean that
> reading from "copy" will dredge up the non-zero data from "base",
> which is NOT a faithful mirroring of "active"?
No, bdv_aio_write_zeroes+BDRV_REQ_MAY_UNMAP only unmaps if it results
in zeroes. In addition, unlike bdrv_aio_discard,
bdrv_aio_write_zeroes will do a real write of zeroes if [sector_num,
sector_num+nb_sectors) is not aligned to the disk's unmap granularity.
Paolo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJVYzPhAAoJEL/70l94x66DGMYIAKKGQIts+Ve689Iar0P6TmXz
BOO0xKJm477PAP9pvUtnGnpt+g2+OqKp0VBTu4F3tbLIQLQOZT1kAZ9oxJ9PMnEa
69c8n86DWdJIgx1lcnOI2wgjaoG65e2K2MH3vYs2Rj6ZD65/FfsF7+oj/R9zCgZm
MIMSiW/fbC5EjBQxOTkDWekuB+/iNRtV9K8YBCtmb8ZlF28X3FPrdZnoqcZGtxPL
RoGYLckjEuLMLSsDH3Frb1+lfKpCaSlJ203ihQQfXzr/8UBH4zOqPZOTbrhdA1pZ
3fHaW5KWyZ1vjW6bb64kpjMnRwCRxB+uAAY4pUmUCZxGsHxh19hGUeSuOexFvqc=
=GUVR
-----END PGP SIGNATURE-----
- [Qemu-stable] [PATCH v4 0/8] block: Mirror discarded sectors, Fam Zheng, 2015/05/21
- [Qemu-stable] [PATCH v4 1/8] block: Add "base" option to bdrv_get_block_status, Fam Zheng, 2015/05/21
- [Qemu-stable] [PATCH v4 2/8] qmp: Add optional bool "unmap" to drive-mirror, Fam Zheng, 2015/05/21
- [Qemu-stable] [PATCH v4 3/8] mirror: Do zero write on target if sectors not allocated, Fam Zheng, 2015/05/21
- [Qemu-stable] [PATCH v4 4/8] block: Fix dirty bitmap in bdrv_co_discard, Fam Zheng, 2015/05/21
- [Qemu-stable] [PATCH v4 5/8] block: Remove bdrv_reset_dirty, Fam Zheng, 2015/05/21
- [Qemu-stable] [PATCH v4 6/8] qemu-iotests: Make block job methods common, Fam Zheng, 2015/05/21
- [Qemu-stable] [PATCH v4 7/8] qemu-iotests: Add test case for mirror with unmap, Fam Zheng, 2015/05/21
- [Qemu-stable] [PATCH v4 8/8] iotests: Use event_wait in wait_ready, Fam Zheng, 2015/05/21