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

Commit 43674f52 authored by Daniel Zheng's avatar Daniel Zheng Committed by Android (Google) Code Review
Browse files

Merge "snapuserd: use disable_verification option" into main

parents aa4e8fdf f1f6134b
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -95,9 +95,6 @@ class ISnapshotHandlerManager {
    // Returns whether all snapshots have verified.
    virtual bool GetVerificationStatus() = 0;

    // Disable partition verification
    virtual void DisableVerification() = 0;

    // Pause Merge threads
    virtual void PauseMerge() = 0;

@@ -123,7 +120,6 @@ class SnapshotHandlerManager final : public ISnapshotHandlerManager {
    void TerminateMergeThreads() override;
    double GetMergePercentage() override;
    bool GetVerificationStatus() override;
    void DisableVerification() override { perform_verification_ = false; }
    void PauseMerge() override;
    void ResumeMerge() override;

+1 −1
Original line number Diff line number Diff line
@@ -323,7 +323,7 @@ bool SnapshotHandler::Start() {
    // Now that the worker threads are up, scan the partitions.
    // If the snapshot-merge is being resumed, there is no need to scan as the
    // current slot is already marked as boot complete.
    if (perform_verification_ && !resume_merge_) {
    if (!handler_options_.skip_verification && !resume_merge_) {
        update_verify_->VerifyUpdatePartition();
    }

+0 −1
Original line number Diff line number Diff line
@@ -243,7 +243,6 @@ class SnapshotHandler : public std::enable_shared_from_this<SnapshotHandler> {
    bool merge_monitored_ = false;
    bool attached_ = false;
    bool scratch_space_ = false;
    bool perform_verification_ = true;
    bool resume_merge_ = false;
    bool merge_complete_ = false;
    HandlerOptions handler_options_;
+3 −3
Original line number Diff line number Diff line
@@ -367,9 +367,9 @@ std::shared_ptr<HandlerThread> UserSnapshotServer::AddHandler(const std::string&
        options.num_worker_threads = 1;
    }

    if (options.skip_verification || android::base::EndsWith(misc_name, "-init") ||
        is_socket_present_ || (access(kBootSnapshotsWithoutSlotSwitch, F_OK) == 0)) {
        handlers_->DisableVerification();
    if (android::base::EndsWith(misc_name, "-init") || is_socket_present_ ||
        (access(kBootSnapshotsWithoutSlotSwitch, F_OK) == 0)) {
        options.skip_verification = true;
    }

    auto opener = block_server_factory_->CreateOpener(misc_name);
+1 −1
Original line number Diff line number Diff line
@@ -729,12 +729,12 @@ void SnapuserdTest::CreateCowDeviceOrderedOps() {
void SnapuserdTest::InitCowDevice() {
    auto factory = harness_->GetBlockServerFactory();
    auto opener = factory->CreateOpener(system_device_ctrl_name_);
    handlers_->DisableVerification();
    const TestParam params = GetParam();
    HandlerOptions options = {
            .num_worker_threads = 1,
            .use_iouring = params.io_uring,
            .o_direct = params.o_direct,
            .skip_verification = true,
            .cow_op_merge_size = params.cow_op_merge_size,
            .verify_block_size = params.verification_block_size,
            .num_verification_threads = params.num_verification_threads,