From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkZcu-0002qD-No for qemu-devel@nongnu.org; Thu, 15 Sep 2016 12:35:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkZcp-0004LH-MO for qemu-devel@nongnu.org; Thu, 15 Sep 2016 12:35:04 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:22842 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkZcp-0004Ha-9x for qemu-devel@nongnu.org; Thu, 15 Sep 2016 12:34:59 -0400 From: "Denis V. Lunev" Date: Thu, 15 Sep 2016 19:34:48 +0300 Message-Id: <1473957290-13382-1-git-send-email-den@openvz.org> Subject: [Qemu-devel] [PATCH v3 0/2] mirror: fix improperly filled copy_bitmap for mirror block job List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: den@openvz.org, Stefan Hajnoczi , Fam Zheng , Kevin Wolf , Max Reitz , Jeff Cody bdrv_is_allocated_above() returns true in the case even for completel zeroed areas as BDRV_BLOCK_ALLOCATED flag is set in both cases. The patch stops using bdrv_is_allocated_above() wrapper and switches to bdrv_get_block_status_above() to distinguish zeroed areas and areas with data to avoid extra IO operations if possible. Though this change requires some preparations in bdrv_get_block_status_above() performed in the patch (1). Changes from v2: - reworked patch 1 to properly hide data below short image - fixed comment in patch 1 - fixed mask assignment in patch 2 to cover bdrv_is_zero_initialized() case Changes from v1: - fixed assert in 041 test case (added patch 1) - fixed commit message - fixed status check to be on the safe side Signed-off-by: Denis V. Lunev CC: Stefan Hajnoczi CC: Fam Zheng CC: Kevin Wolf CC: Max Reitz CC: Jeff Cody Denis V. Lunev (2): block: sync bdrv_co_get_block_status_above() with bdrv_is_allocated_above() mirror: fix improperly filled copy_bitmap for mirror block job block/io.c | 25 ++++++++++++++++++++----- block/mirror.c | 17 +++++++++++------ 2 files changed, 31 insertions(+), 11 deletions(-) -- 2.7.4