[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] block: mirror - zero unallocat
From: |
Jeff Cody |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] block: mirror - zero unallocated target sectors when zero init not present |
Date: |
Mon, 28 Sep 2015 17:58:44 -0400 |
On Sep 28, 2015 5:34 PM, "Kevin Wolf" <address@hidden> wrote:
>
> Am 28.09.2015 um 05:29 hat Jeff Cody geschrieben:
> > During mirror, if the target device does not have support zero
> > initialization, a mirror may result in a corrupt image.
> >
> > For instance, on mirror to a host device with format = raw, whatever
> > random data is on the target device will still be there for unallocated
> > sectors.
> >
> > This is because during the mirror, we set the dirty bitmap to copy only
> > sectors allocated above 'base'. In the case of target devices where we
> > cannot assume unallocated sectors will be read as zeroes, we need to
> > explicitely zero out this data.
> >
> > In order to avoid zeroing out all sectors of the target device prior to
> > mirroring, we do zeroing as part of the block job. A second dirty
> > bitmap cache is created, to track sectors that are unallocated above
> > 'base'. These sectors are then checked for status of BDRV_BLOCK_ZERO
> > on the target - if they are not, then zeroes are explicitly written.
> >
> > This only occurs under two conditions:
> >
> > 1. 'mode' != "existing"
> > 2. bdrv_has_zero_init(target) == NULL
> >
> > We perform the mirroring through mirror_iteration() as before, except
> > in two passes. If the above two conditions are met, the first pass
> > is using the bitmap tracking unallocated sectors, to write the needed
> > zeroes. Then, the second pass is performed, to mirror the actual data
> > as before.
> >
> > If the above two conditions are not met, then the first pass is skipped,
> > and only the second pass (the one with the actual data) is performed.
> >
> > Signed-off-by: Jeff Cody <address@hidden>
>
> Also, this makes qemu-iotests 097 fail for me.
>
OK, thanks - I'll check that out tomorrow afternoon. I ran iotests on all the tests I thought dealt with mirror, but I must have missed that one with my grep.
Jeff
- Re: [Qemu-block] [PATCH 2/3] block: mirror - split out part of mirror_run(), (continued)
- [Qemu-block] [PATCH 3/3] block: mirror - zero unallocated target sectors when zero init not present, Jeff Cody, 2015/09/27
- Re: [Qemu-block] [PATCH 3/3] block: mirror - zero unallocated target sectors when zero init not present, Kevin Wolf, 2015/09/29
- Re: [Qemu-block] [PATCH 3/3] block: mirror - zero unallocated target sectors when zero init not present, Kevin Wolf, 2015/09/29
- Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] block: mirror - zero unallocated target sectors when zero init not present,
Jeff Cody <=
- Re: [Qemu-block] [PATCH 3/3] block: mirror - zero unallocated target sectors when zero init not present, Stefan Hajnoczi, 2015/09/29
- Re: [Qemu-block] [PATCH 3/3] block: mirror - zero unallocated target sectors when zero init not present, Max Reitz, 2015/09/29