Received: from eggs.gnu.org ([2001:4830:134:3::10]:37894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyjer-0000xS-Gx for qemu-devel@nongnu.org; Tue, 17 Nov 2015 12:03:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zyjeo-0003OQ-Aj for qemu-devel@nongnu.org; Tue, 17 Nov 2015 12:03:05 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:48874 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyjen-0003OA-UO for qemu-devel@nongnu.org; Tue, 17 Nov 2015 12:03:02 -0500 From: "Denis V. Lunev" Date: Tue, 17 Nov 2015 20:02:58 +0300 Message-Id: <1447779778-26062-1-git-send-email-den@openvz.org> Subject: [Qemu-devel] [PATCH for 2.5 1/1] parallels: dirty BAT properly for continuous allocations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Denis V. Lunev" , Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, Stefan Hajnoczi From: Vladimir Sementsov-Ogievskiy This patch marks part of the BAT dirty properly. There is a possibility that multy-block allocation could have one block allocated on one BAT page and next block on the next page. The code without the patch could not save updated position to the file. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev CC: Stefan Hajnoczi --- block/parallels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/parallels.c b/block/parallels.c index 4f79293..f689fde 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -220,7 +220,7 @@ static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num, s->bat_bitmap[idx + i] = cpu_to_le32(s->data_end / s->off_multiplier); s->data_end += s->tracks; bitmap_set(s->bat_dirty_bmap, - bat_entry_off(idx) / s->bat_dirty_block, 1); + bat_entry_off(idx + i) / s->bat_dirty_block, 1); } return bat2sect(s, idx) + sector_num % s->tracks; -- 2.1.4