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

Commit 74c55e94 authored by Akilesh Kailash's avatar Akilesh Kailash
Browse files

libsnapshot: GetReminingTime not required after mapping dm-user



After MapDmUserCow, there is no further calls in this function. Snapshot
is mapped; Hence, checking remaining time is not required as
it may return false if the time was exceeded. This would mean function returning false even though snapshots were successfully mapped.

Bug: 291288998
Test: OTA

Change-Id: I4fd8fa6ef90a48885392297f217361507268ba51
Signed-off-by: default avatarAkilesh Kailash <akailash@google.com>
parent 6044e8e4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2490,9 +2490,6 @@ bool SnapshotManager::MapPartitionWithSnapshot(LockedFile* lock,
        }
        created_devices.EmplaceBack<AutoUnmapDevice>(&dm_, name);

        remaining_time = GetRemainingTime(params.timeout_ms, begin);
        if (remaining_time.count() < 0) return false;

        cow_device = new_cow_device;
    }

@@ -2507,6 +2504,9 @@ bool SnapshotManager::MapPartitionWithSnapshot(LockedFile* lock,
    // the user-space will not start the merge. We have to explicitly inform the
    // daemon to resume the merge. Check ProcessUpdateState() call stack.
    if (!UpdateUsesUserSnapshots(lock)) {
        remaining_time = GetRemainingTime(params.timeout_ms, begin);
        if (remaining_time.count() < 0) return false;

        std::string path;
        if (!MapSnapshot(lock, params.GetPartitionName(), base_device, cow_device, remaining_time,
                         &path)) {