From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwtWj-0008Vi-Fq for qemu-devel@nongnu.org; Mon, 25 May 2015 10:38:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YwtWe-0002Vh-P8 for qemu-devel@nongnu.org; Mon, 25 May 2015 10:38:49 -0400 Message-ID: <556333E4.3020602@redhat.com> Date: Mon, 25 May 2015 16:38:28 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1432266060-22104-1-git-send-email-famz@redhat.com> <1432266060-22104-4-git-send-email-famz@redhat.com> <555F8FA5.9050209@redhat.com> In-Reply-To: <555F8FA5.9050209@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 3/8] mirror: Do zero write on target if sectors not allocated List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, Jeff Cody , qemu-stable@nongnu.org, Stefan Hajnoczi , jsnow@redhat.com, wangxiaolong@ucloud.cn -----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-----