From 2e09d6f6c7bbf21fb55b4698d7f6718aa7eea229 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Thu, 15 Nov 2018 16:19:15 +0900 Subject: [PATCH] Unmount only mount-update recover Change-Id: I6cd8835fba89d82a5ac2edb703ab246f223256a3 Signed-off-by: Junghyun Yeon --- src/common/step/mount/step_mount_recover.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/common/step/mount/step_mount_recover.cc b/src/common/step/mount/step_mount_recover.cc index 4fef1f6..036c3ff 100644 --- a/src/common/step/mount/step_mount_recover.cc +++ b/src/common/step/mount/step_mount_recover.cc @@ -35,11 +35,31 @@ Step::Status StepMountRecover::RecoveryMountUpdate() { } Step::Status StepMountRecover::clean() { + recovery::RecoveryFile* recovery_file = + context_->recovery_info.get().recovery_file.get(); + if (!recovery_file) { + LOG(ERROR) << "Failed to get recovery info"; + return Status::RECOVERY_ERROR; + } + + if (recovery_file->type() != RequestType::MountUpdate) + return Status::OK; + UmountPackagePath(); return Status::OK; } Step::Status StepMountRecover::undo() { + recovery::RecoveryFile* recovery_file = + context_->recovery_info.get().recovery_file.get(); + if (!recovery_file) { + LOG(ERROR) << "Failed to get recovery info"; + return Status::RECOVERY_ERROR; + } + + if (recovery_file->type() != RequestType::MountUpdate) + return Status::OK; + UmountPackagePath(); return Status::OK; } -- 2.7.4