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

Commit 02df85cf authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

Merge "Handle zero snapshot size appropriately." into rvc-dev am: 5b182952...

Merge "Handle zero snapshot size appropriately." into rvc-dev am: 5b182952 am: c3b03768 am: a06d7985

Change-Id: I5a0e7e51de0af0754fa4cd6a3b601ad832435eee
parents a314341d a06d7985
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -181,6 +181,13 @@ std::optional<PartitionCowCreator::Return> PartitionCowCreator::Run() {
    ret.snapshot_status.set_device_size(target_partition->size());
    ret.snapshot_status.set_snapshot_size(target_partition->size());

    if (ret.snapshot_status.snapshot_size() == 0) {
        LOG(INFO) << "Not creating snapshot for partition " << ret.snapshot_status.name();
        ret.snapshot_status.set_cow_partition_size(0);
        ret.snapshot_status.set_cow_file_size(0);
        return ret;
    }

    // Being the COW partition virtual, its size doesn't affect the storage
    // memory that will be occupied by the target.
    // The actual storage space is affected by the COW file, whose size depends