Patchwork [RFC,V3,19/24] qcow2: Add verification of dedup table.

login
register
mail settings
Submitter Benoît Canet
Date Nov. 26, 2012, 1:05 p.m.
Message ID <1353935123-24199-20-git-send-email-benoit@irqsave.net>
Download mbox | patch
Permalink /patch/201697/
State New
Headers show

Comments

Benoît Canet - Nov. 26, 2012, 1:05 p.m.
Signed-off-by: Benoit Canet <benoit@irqsave.net>
---
 block/qcow2-refcount.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Patch

diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index efc1179..16aa8a2 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -1168,6 +1168,14 @@  int qcow2_check_refcounts(BlockDriverState *bs, BdrvCheckResult *res,
         goto fail;
     }
 
+    if (s->has_dedup) {
+        ret = check_refcounts_l1(bs, res, refcount_table, nb_clusters,
+                                 s->dedup_table_offset, s->dedup_table_size, 0);
+        if (ret < 0) {
+            goto fail;
+        }
+    }
+
     /* snapshots */
     for(i = 0; i < s->nb_snapshots; i++) {
         sn = s->snapshots + i;