mirror: do not increase offset during initial zero_or_discard phase
commit90ab48eb07d5d98b2fb81ced3c27bba828472569
authorAnton Nefedov <anton.nefedov@virtuozzo.com>
Thu, 2 Feb 2017 14:25:15 +0000 (2 17:25 +0300)
committerJeff Cody <jcody@redhat.com>
Tue, 21 Feb 2017 15:38:00 +0000 (21 10:38 -0500)
tree90537addc72baa02aae02135d6f298b4a6a72bf5
parentb1660997125099db2c0cd7f54f6664fbd93bad00
mirror: do not increase offset during initial zero_or_discard phase

If explicit zeroing out before mirroring is required for the target image,
it moves the block job offset counter to EOF, then offset and len counters
count the image size twice. There is no harm but stats are confusing,
specifically the progress of the operation is always reported as 99% by
management tools.

The patch skips offset increase for the first "technical" pass over the
image. This should not cause any further harm.

Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1486045515-8009-1-git-send-email-den@openvz.org
CC: Jeff Cody <jcody@redhat.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Max Reitz <mreitz@redhat.com>
CC: Eric Blake <eblake@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
block/mirror.c