On Thu, 06/16 09:58, Denis V. Lunev wrote: > Actually we must set dirty bitmap dirty after we have written all our > zeroes for correct processing in drive mirror code. In the other case > we can face not zeroes in this dirty area there in mirror_iteration. > > Signed-off-by: Denis V. Lunev <d...@openvz.org> > CC: Vladimir Sementsov-Ogievskiy<vsement...@virtuozzo.com> > CC: Stefan Hajnoczi <stefa...@redhat.com> > CC: Fam Zheng <f...@redhat.com> > CC: Kevin Wolf <kw...@redhat.com> > CC: Max Reitz <mre...@redhat.com> > --- > block/io.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/block/io.c b/block/io.c > index b51f681..513bd99 100644 > --- a/block/io.c > +++ b/block/io.c > @@ -2265,7 +2265,6 @@ int coroutine_fn bdrv_co_discard(BlockDriverState *bs, > int64_t sector_num, > > tracked_request_begin(&req, bs, NULL, sector_num << BDRV_SECTOR_BITS, > nb_sectors << BDRV_SECTOR_BITS, > BDRV_TRACKED_DISCARD); > - bdrv_set_dirty(bs, sector_num, nb_sectors); > > max_discard = MIN_NON_ZERO(bs->bl.max_discard, BDRV_REQUEST_MAX_SECTORS); > while (nb_sectors > 0) { > @@ -2314,6 +2313,8 @@ int coroutine_fn bdrv_co_discard(BlockDriverState *bs, > int64_t sector_num, > } > ret = 0; > out: > + bdrv_set_dirty(bs, req.offset << BDRV_SECTOR_BITS, > + req.bytes << BDRV_SECTOR_BITS); > tracked_request_end(&req); > return ret; > } > -- > 2.5.0 >
Reviewed-by: Fam Zheng <f...@redhat.com>