summary refs log tree commit diff
path: root/sync
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2018-11-08 15:02:53 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-12-04 00:11:37 -0800
commit2ea8f3d0aa7230da41b3e6beba27ff9140f661d3 (patch)
treee6ade84f6552afbc4172e4b63bbff5caf3f3c455 /sync
parentf5032762919ad6fcfd2436abb0ba6ddf73f237d3 (diff)
downloadcrosvm-2ea8f3d0aa7230da41b3e6beba27ff9140f661d3.tar
crosvm-2ea8f3d0aa7230da41b3e6beba27ff9140f661d3.tar.gz
crosvm-2ea8f3d0aa7230da41b3e6beba27ff9140f661d3.tar.bz2
crosvm-2ea8f3d0aa7230da41b3e6beba27ff9140f661d3.tar.lz
crosvm-2ea8f3d0aa7230da41b3e6beba27ff9140f661d3.tar.xz
crosvm-2ea8f3d0aa7230da41b3e6beba27ff9140f661d3.tar.zst
crosvm-2ea8f3d0aa7230da41b3e6beba27ff9140f661d3.zip
qcow: scan for free clusters at startup
During runtime, we track unreferenced clusters (via unref_clusters and
avail_clusters) and reuse them before extending the disk image.
However, across boots, we did not previously recover the list of
unreferenced clusters, so the disk file could grow beyond the range that
the reference table count represent.  This patch adds a boot-time scan
for all unreferenced clusters so that they get reused.

BUG=chromium:899273
TEST=Boot with qcow2 image, fill the disk with dd, delete the dd'd file,
refill with dd, and so on, repeatedly. Ensure that the disk image does
not grow beyond the expected max size and that no clusters beyond the
size of the refcount table are used.

Change-Id: Idd21b08bb4c55b8244e7ecaccafc4ccc46b7b17a
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1327822
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Diffstat (limited to 'sync')
0 files changed, 0 insertions, 0 deletions