From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrSmW-0002Y9-MX for qemu-devel@nongnu.org; Thu, 20 Nov 2014 09:32:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrSmS-0005KO-6J for qemu-devel@nongnu.org; Thu, 20 Nov 2014 09:32:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrSmR-0005KI-Vw for qemu-devel@nongnu.org; Thu, 20 Nov 2014 09:32:20 -0500 Message-ID: <546DFB6F.3020200@redhat.com> Date: Thu, 20 Nov 2014 15:32:15 +0100 From: Max Reitz MIME-Version: 1.0 References: <1415719671-16257-1-git-send-email-mreitz@redhat.com> In-Reply-To: <1415719671-16257-1-git-send-email-mreitz@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6] qcow2: Buffer L1 table in snapshot refcount update List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Zhang Haoyu , Stefan Hajnoczi On 2014-11-11 at 16:27, Max Reitz wrote: > From: Zhang Haoyu > > Buffer the active L1 table in qcow2_update_snapshot_refcount() in order > to prevent in-place conversion of the L1 table buffer in the > BDRVQcowState to big endian and back, which would lead to data > corruption if that buffer was accessed concurrently. This should not > happen but better being safe than sorry. > > Signed-off-by: Zhang Haoyu > Signed-off-by: Max Reitz > --- > v6 for "snapshot: use local variable to bdrv_pwrite_sync L1 table" (I > changed the commit message wording to make it more clear what this patch > does and why we want it). > > Changes in v6: > - Only copy the local buffer back into s->l1_table if we are indeed > accessing the local L1 table > - Use qemu_vfree() instead of g_free() > --- > block/qcow2-refcount.c | 30 ++++++++++++++---------------- > 1 file changed, 14 insertions(+), 16 deletions(-) Ping