Skip to content

Commit 71ab9db

Browse files
committed
libsnapshot: Do not attempt compression features in recovery.
Test: adb sideload Change-Id: Ic69fc2f5c37a5d4fc0fcd0819ebf58e0249f7773
1 parent ad7d1d1 commit 71ab9db

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fs_mgr/libsnapshot/snapshot.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,10 +2130,6 @@ bool SnapshotManager::UnmapCowDevices(LockedFile* lock, const std::string& name)
21302130
bool SnapshotManager::UnmapDmUserDevice(const std::string& snapshot_name) {
21312131
auto& dm = DeviceMapper::Instance();
21322132

2133-
if (!EnsureSnapuserdConnected()) {
2134-
return false;
2135-
}
2136-
21372133
auto dm_user_name = GetDmUserCowName(snapshot_name);
21382134
if (dm.GetState(dm_user_name) == DmDeviceState::INVALID) {
21392135
return true;
@@ -2144,6 +2140,9 @@ bool SnapshotManager::UnmapDmUserDevice(const std::string& snapshot_name) {
21442140
return false;
21452141
}
21462142

2143+
if (!EnsureSnapuserdConnected()) {
2144+
return false;
2145+
}
21472146
if (!snapuserd_client_->WaitForDeviceDelete(dm_user_name)) {
21482147
LOG(ERROR) << "Failed to wait for " << dm_user_name << " control device to delete";
21492148
return false;
@@ -2585,8 +2584,9 @@ Return SnapshotManager::CreateUpdateSnapshots(const DeltaArchiveManifest& manife
25852584
// these devices.
25862585
AutoDeviceList created_devices;
25872586

2588-
bool use_compression =
2589-
IsCompressionEnabled() && manifest.dynamic_partition_metadata().vabc_enabled();
2587+
bool use_compression = IsCompressionEnabled() &&
2588+
manifest.dynamic_partition_metadata().vabc_enabled() &&
2589+
!device_->IsRecovery();
25902590

25912591
PartitionCowCreator cow_creator{
25922592
.target_metadata = target_metadata.get(),

0 commit comments

Comments
 (0)