From b86df7687bf028a70481d1a8fdbf50d65f795102 Mon Sep 17 00:00:00 2001 From: Yi-Yo Chiang Date: Fri, 5 Jan 2024 16:47:14 +0800 Subject: [PATCH] remount: remount partitions with noatime Related change: r.android.com/1110379 noatime reduces the wear and tear on the flash device. Bug: 313609600 Test: abtd adb-remount-test Change-Id: Ia42a064f297c25d3463a4ed9094a66236a6c5708 --- fs_mgr/fs_mgr_remount.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs_mgr/fs_mgr_remount.cpp b/fs_mgr/fs_mgr_remount.cpp index 7ba4d2be4..733ba2f20 100644 --- a/fs_mgr/fs_mgr_remount.cpp +++ b/fs_mgr/fs_mgr_remount.cpp @@ -380,8 +380,8 @@ bool RemountPartition(Fstab& fstab, Fstab& mounts, FstabEntry& entry) { // Now remount! for (const auto& mnt_point : {mount_point, entry.mount_point}) { - if (::mount(blk_device.c_str(), mnt_point.c_str(), entry.fs_type.c_str(), MS_REMOUNT, - nullptr) == 0) { + if (::mount(blk_device.c_str(), mnt_point.c_str(), entry.fs_type.c_str(), + MS_REMOUNT | MS_NOATIME, nullptr) == 0) { LOG(INFO) << "Remounted " << mnt_point << " as RW"; return true; }