Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fea51309 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "libsnapshot: Call EnsureImageManager before RemoveAllImages"

parents 51fb2a08 e62591ec
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -132,7 +132,9 @@ bool SnapshotManager::BeginUpdate() {
    // Purge the ImageManager just in case there is a corrupt lp_metadata file
    // lying around. (NB: no need to return false on an error, we can let the
    // update try to progress.)
    if (EnsureImageManager()) {
        images_->RemoveAllImages();
    }

    auto state = ReadUpdateState(file.get());
    if (state != UpdateState::None) {
@@ -1203,7 +1205,7 @@ bool SnapshotManager::RemoveAllSnapshots(LockedFile* lock) {
        // being cancelled due to some corrupted state in an lp_metadata file.
        // Note that we do not do this if some cow images are still mapped,
        // since we must not remove backing storage if it's in use.
        if (!images_->RemoveAllImages()) {
        if (!EnsureImageManager() || !images_->RemoveAllImages()) {
            LOG(ERROR) << "Could not remove all snapshot artifacts";
            return false;
        }