Merge "remount: Remove errno test & improve messaging of fs_mgr_overlayfs_mount_all"
This commit is contained in:
commit
7214c98d2e
2 changed files with 8 additions and 9 deletions
|
|
@ -1331,22 +1331,22 @@ static void TryMountScratch() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fs_mgr_overlayfs_mount_all(Fstab* fstab) {
|
bool fs_mgr_overlayfs_mount_all(Fstab* fstab) {
|
||||||
auto ret = false;
|
if (fs_mgr_overlayfs_invalid()) {
|
||||||
if (fs_mgr_overlayfs_invalid()) return ret;
|
return false;
|
||||||
|
}
|
||||||
|
auto ret = true;
|
||||||
auto scratch_can_be_mounted = true;
|
auto scratch_can_be_mounted = true;
|
||||||
for (const auto& entry : fs_mgr_overlayfs_candidate_list(*fstab)) {
|
for (const auto& entry : fs_mgr_overlayfs_candidate_list(*fstab)) {
|
||||||
if (fs_mgr_is_verity_enabled(entry)) continue;
|
if (fs_mgr_is_verity_enabled(entry)) continue;
|
||||||
auto mount_point = fs_mgr_mount_point(entry.mount_point);
|
auto mount_point = fs_mgr_mount_point(entry.mount_point);
|
||||||
if (fs_mgr_overlayfs_already_mounted(mount_point)) {
|
if (fs_mgr_overlayfs_already_mounted(mount_point)) {
|
||||||
ret = true;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (scratch_can_be_mounted) {
|
if (scratch_can_be_mounted) {
|
||||||
scratch_can_be_mounted = false;
|
scratch_can_be_mounted = false;
|
||||||
TryMountScratch();
|
TryMountScratch();
|
||||||
}
|
}
|
||||||
if (fs_mgr_overlayfs_mount(mount_point)) ret = true;
|
ret &= fs_mgr_overlayfs_mount(mount_point);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -451,10 +451,9 @@ static int do_remount(Fstab& fstab, const std::vector<std::string>& partition_ar
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mount overlayfs.
|
// Mount overlayfs.
|
||||||
errno = 0;
|
if (!fs_mgr_overlayfs_mount_all(&partitions)) {
|
||||||
if (!fs_mgr_overlayfs_mount_all(&partitions) && errno) {
|
LOG(WARNING) << "Cannot mount overlayfs for some partitions";
|
||||||
PLOG(ERROR) << "Can not mount overlayfs for partitions";
|
// Continue regardless to handle raw remount case.
|
||||||
return BAD_OVERLAY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get actual mounts _after_ overlayfs has been added.
|
// Get actual mounts _after_ overlayfs has been added.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue