From df349dcccc43dc45f4ff0ba8eb10c3f59f4f4f17 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Thu, 28 Apr 2022 21:22:30 -0400 Subject: [PATCH 4/4] fs_mgr: trigger the use of overlayfs earlier At 1%, it's barely useable to do anything at all if remounted rw --- fs_mgr/fs_mgr_overlayfs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs_mgr/fs_mgr_overlayfs.cpp b/fs_mgr/fs_mgr_overlayfs.cpp index 4d32bda80..ec6fef89a 100644 --- a/fs_mgr/fs_mgr_overlayfs.cpp +++ b/fs_mgr/fs_mgr_overlayfs.cpp @@ -176,7 +176,7 @@ bool fs_mgr_dir_is_writable(const std::string& path) { return ret | !rmdir(test_directory.c_str()); } -// At less than 1% or 8MB of free space return value of false, +// At less than 20% or 8MB of free space return value of false, // means we will try to wrap with overlayfs. bool fs_mgr_filesystem_has_space(const std::string& mount_point) { // If we have access issues to find out space remaining, return true @@ -188,7 +188,7 @@ bool fs_mgr_filesystem_has_space(const std::string& mount_point) { return true; } - static constexpr int kPercentThreshold = 1; // 1% + static constexpr int kPercentThreshold = 20; // 20% static constexpr unsigned long kSizeThreshold = 8 * 1024 * 1024; // 8MB return (vst.f_bfree >= (vst.f_blocks * kPercentThreshold / 100)) && -- 2.36.0