fs_mgt: Fix remount failure in case of non-overlayfs system
$ adb remount
W DM_DEV_STATUS failed for scratch: No such device or address
E Can not mount overlayfs for partitions: No such file or directory
/system/bin/remount exited with status 8
remount failed
Bug: 138407617
Test: $ adb remount
Change-Id: I0f359071234b57324ad2324905b5239dbfa44d01
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/fs_mgr/fs_mgr_overlayfs.cpp b/fs_mgr/fs_mgr_overlayfs.cpp
index ac15ce4..2f0bf7d 100644
--- a/fs_mgr/fs_mgr_overlayfs.cpp
+++ b/fs_mgr/fs_mgr_overlayfs.cpp
@@ -1009,7 +1009,7 @@
Fstab candidates;
for (const auto& entry : fstab) {
FstabEntry new_entry = entry;
- if (!fs_mgr_overlayfs_already_mounted(entry.mount_point) &&
+ if (!fs_mgr_overlayfs_already_mounted(entry.mount_point) ||
!fs_mgr_wants_overlayfs(&new_entry)) {
continue;
}