Merge "fs_mgr: overlayfs: noatime"

This commit is contained in:
Treehugger Robot 2019-08-29 16:49:04 +00:00 committed by Gerrit Code Review
commit a133690fc4
2 changed files with 7 additions and 2 deletions

View file

@ -713,7 +713,7 @@ bool fs_mgr_overlayfs_mount(const std::string& mount_point) {
}
report = report + ")=";
auto ret = mount("overlay", mount_point.c_str(), "overlay", MS_RDONLY | MS_RELATIME,
auto ret = mount("overlay", mount_point.c_str(), "overlay", MS_RDONLY | MS_NOATIME,
options.c_str());
if (ret) {
retval = false;
@ -776,7 +776,7 @@ bool fs_mgr_overlayfs_mount_scratch(const std::string& device_path, const std::s
entry.fs_type = mnt_type;
if ((mnt_type == "f2fs") && !f2fs) entry.fs_type = "ext4";
if ((mnt_type == "ext4") && !ext4) entry.fs_type = "f2fs";
entry.flags = MS_RELATIME;
entry.flags = MS_NOATIME;
if (readonly) {
entry.flags |= MS_RDONLY;
} else {

View file

@ -1190,6 +1190,11 @@ if ${overlayfs_needed}; then
skip_unrelated_mounts |
grep " overlay ro,") ||
die "remount overlayfs missed a spot (ro)"
!(adb_sh grep -v noatime /proc/mounts </dev/null |
skip_administrative_mounts data |
skip_unrelated_mounts |
grep '.') ||
die "mounts are not noatime"
D=`adb_sh grep " rw," /proc/mounts </dev/null |
skip_administrative_mounts data`
if echo "${D}" | grep /dev/root >/dev/null; then