mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
When converting a compressed cluster to standard during write operations, the old compressed cluster's refcount was never decremented, causing leak warnings by `qemu-img check ..` `Leaked cluster X refcount=N reference=M` Additionally, compressed data can span multiple physical clusters, not just one. The compressed cluster address and size are encoded in the L2 entry, and the data may cross cluster boundaries. The proper handling is implemented as follows: - Extract compressed cluster address and size before overwriting L2 entry - Identify all clusters occupied by the compressed data - Decrement refcount for each cluster in the range Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>