fs_mgr_overlayfs: Fallback to allocate scratch on super if /data failed
b/255593675 showed that gsid can fail to allocate scratch on /data on
some device configurations. Before we can locate the root cause,
gracefully fallback to previous "scratch-on-super" logic in case of
error.
Bug: 255593675
Test: Presubmit
Test: manual test
Change-Id: I229ab51f11fa354a6f231c4d083dd6329d6a9579
diff --git a/fs_mgr/fs_mgr_overlayfs.cpp b/fs_mgr/fs_mgr_overlayfs.cpp
index ef426dc..6290057 100644
--- a/fs_mgr/fs_mgr_overlayfs.cpp
+++ b/fs_mgr/fs_mgr_overlayfs.cpp
@@ -1133,7 +1133,9 @@
// Try ImageManager on /data first.
bool can_use_data = false;
if (FilesystemHasReliablePinning("/data", &can_use_data) && can_use_data) {
- return CreateScratchOnData(scratch_device, partition_exists);
+ if (CreateScratchOnData(scratch_device, partition_exists)) {
+ return true;
+ }
}
// If that fails, see if we can land on super.
if (CanUseSuperPartition(fstab)) {