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

Commit e49a9df8 authored by David Anderson's avatar David Anderson
Browse files

libsnapshot: Don't call RemoveAllSnapshots on normal boot.

This change was made when hardening recovery against libsnapshot bugs,
but was too aggressive. It's causing gsid to start, and due to an issue
in libgsid, get retained indefinitely. Dial it back a bit.

Bug: 397325642
Test: boot, ps -A | grep gsid
Change-Id: If013eb1d9082ca1f98bc4f3a26209af38b07e1cc
parent 9ea5cbf7
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -351,10 +351,15 @@ bool SnapshotManager::RemoveAllUpdateState(LockedFile* lock, const std::function

    LOG(INFO) << "Removing all update state.";

    if (ReadUpdateState(lock) != UpdateState::None) {
        // Only call this if we're actually cancelling an update. It's not
        // expected to yield anything otherwise, and firing up gsid on normal
        // boot is expensive.
        if (!RemoveAllSnapshots(lock)) {
            LOG(ERROR) << "Could not remove all snapshots";
            return false;
        }
    }

    // It's okay if these fail:
    // - For SnapshotBoot and Rollback, first-stage init performs a deeper check after