qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 07/22] qcow2: Helper function for refcount mo


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v3 07/22] qcow2: Helper function for refcount modification
Date: Fri, 28 Nov 2014 11:11:00 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Nov 20, 2014 at 06:06:23PM +0100, Max Reitz wrote:
> @@ -1711,7 +1746,7 @@ static int calculate_refcounts(BlockDriverState *bs, 
> BdrvCheckResult *res,
>  static void compare_refcounts(BlockDriverState *bs, BdrvCheckResult *res,
>                                BdrvCheckMode fix, bool *rebuild,
>                                int64_t *highest_cluster,
> -                              uint16_t *refcount_table, int64_t nb_clusters)
> +                              void *refcount_table, int64_t nb_clusters)
>  {
>      BDRVQcowState *s = bs->opaque;
>      int64_t i, refcount1, refcount2;

An -ERANGE qcow2_get_refcount() return value is treated as a check error
here and we won't be able to rebuild the refcount blocks:

  refcount1 = qcow2_get_refcount(bs, i);
  if (refcount1 < 0) {
      fprintf(stderr, "Can't get refcount for cluster %" PRId64 ": %s\n",
          i, strerror(-refcount1));
      res->check_errors++;
      continue;
  }

We should allow rebuilding refcount blocks, -ERANGE is just another
corrupted refcount.

Attachment: pgpxTbQDqT85r.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]