[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Fix (at least one cause of) qcow2 corruption.
From: |
Christoph Hellwig |
Subject: |
Re: [Qemu-devel] [PATCH] Fix (at least one cause of) qcow2 corruption. |
Date: |
Thu, 9 Apr 2009 22:44:12 +0200 |
User-agent: |
Mutt/1.3.28i |
On Tue, Mar 31, 2009 at 03:40:54PM -0700, Nolan wrote:
> qcow2's get_cluster_offset() scans forward in the l2 table to find other
> clusters that have the same allocation status as the first cluster.
> This is used by (among others) qcow_is_allocated().
>
> Unfortunately, it was not checking to be sure that it didn't fall off
> the end of the l2 table. This patch adds that check.
>
> The symptom that motivated me to look into this was that
> bdrv_is_allocated() was returning false when there was in fact data
> there. This is one of many ways this bug could lead to data corruption.
>
> I checked the other place that scans for consecutive unallocated blocks
> (alloc_cluster_offset()) and it appears to be OK:
> nb_clusters = MIN(nb_clusters, s->l2_size - l2_index);
> appears to prevent the same problem from occurring.
Do you have a specific I/O patter nthat would trigger this issue?