When a refcount block is evicted from cache and replaced with a new one, the old refcount block cluster was added to unref_clusters but its refcount was never decremented to 0 on disk. This left the cluster with refcount=1 while no metadata referenced it, causing errors in qemu-img check `Leaked cluster X refcount=1 reference=0` This fix recursively calls set_cluster_refcount(freed_cluster, 0) to properly decrement the freed refcount block's refcount on disk. The recursion handles cascading replacements where freeing one refcount block may trigger the replacement of another. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||