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

Commit 23ff37a0 authored by David Anderson's avatar David Anderson Committed by Gerrit Code Review
Browse files

Merge changes Ia17bcc86,I1954b38f

* changes:
  snapuserd: Remove IByteSink usage from legacy snapuserd.
  libsnapshot: Disable another legacy merge path in tests.
parents 3729536f 78d8d5d9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2646,6 +2646,11 @@ TEST_F(SnapshotUpdateTest, QueryStatusError) {
    ASSERT_TRUE(init->InitiateMerge());
    ASSERT_EQ(UpdateState::MergeFailed, init->ProcessUpdateState());

    if (ShouldSkipLegacyMerging()) {
        LOG(INFO) << "Skipping legacy merge in test";
        return;
    }

    // Simulate a reboot that tries the merge again, with the non-failing dm.
    ASSERT_TRUE(UnmapAll());
    init = NewManagerForFirstStageMount("_b");
+9 −3
Original line number Diff line number Diff line
@@ -95,11 +95,17 @@ void WorkerThread::ConstructKernelCowHeader() {
// internal COW format and if the block is compressed,
// it will be de-compressed.
bool WorkerThread::ProcessReplaceOp(const CowOperation* cow_op) {
    if (!reader_->ReadData(*cow_op, &bufsink_)) {
        SNAP_LOG(ERROR) << "ProcessReplaceOp failed for block " << cow_op->new_block;
    void* buffer = bufsink_.GetPayloadBuffer(BLOCK_SZ);
    if (!buffer) {
        SNAP_LOG(ERROR) << "No space in buffer sink";
        return false;
    }
    ssize_t rv = reader_->ReadData(*cow_op, buffer, BLOCK_SZ);
    if (rv != BLOCK_SZ) {
        SNAP_LOG(ERROR) << "ProcessReplaceOp failed for block " << cow_op->new_block
                        << ", return = " << rv;
        return false;
    }

    return true;
}