[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 18/37] Fix error message about compressed clusters wi
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 18/37] Fix error message about compressed clusters with OFLAG_COPIED |
Date: |
Tue, 15 May 2018 17:40:14 +0200 |
From: Alberto Garcia <address@hidden>
Compressed clusters are not supposed to have the COPIED bit set.
"qemu-img check" detects that and prints an error message reporting
the number of the affected host cluster. This doesn't make much sense
because compressed clusters are not aligned to host clusters, so it
would be better to report the offset instead. Plus, the calculation is
wrong and it uses the raw L2 entry as if it was simply an offset.
This patch fixes the error message and reports the offset of the
compressed cluster.
Signed-off-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/qcow2-refcount.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 6b8b63514a..2dc23005b7 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -1577,9 +1577,9 @@ static int check_refcounts_l2(BlockDriverState *bs,
BdrvCheckResult *res,
case QCOW2_CLUSTER_COMPRESSED:
/* Compressed clusters don't have QCOW_OFLAG_COPIED */
if (l2_entry & QCOW_OFLAG_COPIED) {
- fprintf(stderr, "ERROR: cluster %" PRId64 ": "
+ fprintf(stderr, "ERROR: coffset=0x%" PRIx64 ": "
"copied flag must never be set for compressed "
- "clusters\n", l2_entry >> s->cluster_bits);
+ "clusters\n", l2_entry & s->cluster_offset_mask);
l2_entry &= ~QCOW_OFLAG_COPIED;
res->corruptions++;
}
--
2.13.6
- [Qemu-block] [PULL 22/37] iotests: Add failure matching to common.qemu, (continued)
[Qemu-block] [PULL 21/37] docs: Document the new default sizes of the qcow2 caches, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 26/37] block: Add BDRV_REQ_WRITE_UNCHANGED flag, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 28/37] block/quorum: Support BDRV_REQ_WRITE_UNCHANGED, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 18/37] Fix error message about compressed clusters with OFLAG_COPIED,
Kevin Wolf <=
[Qemu-block] [PULL 23/37] iotests: Skip 181 and 201 without userfaultfd, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 27/37] block: Set BDRV_REQ_WRITE_UNCHANGED for COR writes, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 25/37] block: BLK_PERM_WRITE includes ..._UNCHANGED, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 31/37] iotests: Copy 197 for COR filter driver, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 29/37] block: Support BDRV_REQ_WRITE_UNCHANGED in filters, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 24/37] block: Add COR filter driver, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 34/37] block: Document BDRV_REQ_WRITE_UNCHANGED support, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 30/37] iotests: Clean up wrap image in 197, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 33/37] qemu-img: Check post-truncation size, Kevin Wolf, 2018/05/15
[Qemu-block] [PULL 35/37] qemu-io: Use purely string blockdev options, Kevin Wolf, 2018/05/15