Unmount only mount-update recover 44/193144/3
authorJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 15 Nov 2018 07:19:15 +0000 (16:19 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 19 Nov 2018 07:52:19 +0000 (16:52 +0900)
Change-Id: I6cd8835fba89d82a5ac2edb703ab246f223256a3
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/common/step/mount/step_mount_recover.cc

index 4fef1f6..036c3ff 100644 (file)
@@ -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;
 }