From 6659ed8d3964e61c25b412fc3d837c2ef80fcfe9 Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Tue, 28 Jan 2020 13:40:14 +0000 Subject: [PATCH] storage/reflink: delete all images at beginning of create() Ensure that there are no leftover image files for the volume, e.g. from an unsuccessful removal of a previous incarnation of this vid, or from an messily restored pool filesystem backup. We don't want to preserve any stale data (revisions) or metadata (size) in the new incarnation. --- qubes/storage/reflink.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qubes/storage/reflink.py b/qubes/storage/reflink.py index 28a6993f..c626da87 100644 --- a/qubes/storage/reflink.py +++ b/qubes/storage/reflink.py @@ -154,6 +154,7 @@ class ReflinkVolume(qubes.storage.Volume): @_coroutinized @_locked def create(self): + self._remove_all_images() if self.save_on_stop and not self.snap_on_start: _create_sparse_file(self._path_clean, self._get_size()) return self