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

Commit f619311f authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Create_cow: Hash of target blocks should not be stored." into main am:...

Merge "Create_cow: Hash of target blocks should not be stored." into main am: a2cd2202 am: 8cd8ce3f am: 66d0face am: 183f7110

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2759698



Change-Id: I18ecc4abd4c0ef255f8f715b195512a349425377
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b94f5ee9 183f7110
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -240,9 +240,11 @@ bool CreateSnapshot::ReadBlocks(off_t offset, const int skip_blocks, const uint6
            SHA256(bufptr, BLOCK_SZ, checksum);
            std::string hash = ToHexString(checksum, sizeof(checksum));

            if (create_snapshot_patch_ && !WriteSnapshot(bufptr, blkindex, hash)) {
            if (create_snapshot_patch_) {
                if (!WriteSnapshot(bufptr, blkindex, hash)) {
                    LOG(ERROR) << "WriteSnapshot failed for block: " << blkindex;
                    return false;
                }
            } else {
                std::lock_guard<std::mutex> lock(source_block_hash_lock_);
                {
@@ -256,7 +258,7 @@ bool CreateSnapshot::ReadBlocks(off_t offset, const int skip_blocks, const uint6
            num_blocks -= 1;
        }

        file_offset += (skip_blocks * kBlockSizeToRead);
        file_offset += (skip_blocks * to_read);
        if (file_offset >= dev_sz) {
            break;
        }