From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S38Xc-0001cY-FS for qemu-devel@nongnu.org; Thu, 01 Mar 2012 11:07:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S38XS-00079r-Is for qemu-devel@nongnu.org; Thu, 01 Mar 2012 11:07:40 -0500 Message-ID: <4F4F9F91.8080501@redhat.com> Date: Thu, 01 Mar 2012 17:10:57 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1330348561-9340-1-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1330348561-9340-1-git-send-email-stefanha@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] qed: do not evict in-use L2 table cache entries List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org Am 27.02.2012 14:16, schrieb Stefan Hajnoczi: > The L2 table cache reduces QED metadata reads that would be required > when translating LBAs to offsets into the image file. Since requests > execute in parallel it is possible to share an L2 table between multipl= e > requests. >=20 > There is a potential data corruption issue when an in-use L2 table is > evicted from the cache because the following situation occurs: >=20 > 1. An allocating write performs an update to L2 table "A". >=20 > 2. Another request needs L2 table "B" and causes table "A" to be > evicted. >=20 > 3. A new read request needs L2 table "A" but it is not cached. >=20 > As a result the L2 update from #1 can overlap with the L2 fetch from #3. > We must avoid doing overlapping I/O requests here since the worst case > outcome is that the L2 fetch completes before the L2 update and yields > stale data. In that case we would effectively discard the L2 update an= d > lose data clusters! >=20 > Thanks to Beno=C3=AEt Canet for extensive test= ing > and debugging which lead to discovery of this bug. >=20 > Reported-by: Beno=C3=AEt Canet > Signed-off-by: Stefan Hajnoczi Thanks, applied to the block branch. How about a qemu-iotests case? Kevin