]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homed: drop caches harder
authorLennart Poettering <lennart@poettering.net>
Thu, 30 May 2024 07:34:26 +0000 (09:34 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 30 May 2024 12:50:40 +0000 (14:50 +0200)
echoing "2" is apparently not enough to erase inodes/dentrys from
memory, hence use "3", which seems to work.

Fixes: #32596
src/home/homework.c

index af8bcd72a4c2ae7df02e6a87b7e481e718b68283..e10922cefda3f167834b4de4e7fd8aa539430ab9 100644 (file)
@@ -300,10 +300,10 @@ static void drop_caches_now(void) {
         int r;
 
         /* Drop file system caches now. See https://docs.kernel.org/admin-guide/sysctl/vm.html
-         * for details. We write "2" into /proc/sys/vm/drop_caches to ensure dentries/inodes are flushed, but
+         * for details. We write "3" into /proc/sys/vm/drop_caches to ensure dentries/inodes are flushed, but
          * not more. */
 
-        r = write_string_file("/proc/sys/vm/drop_caches", "2\n", WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file("/proc/sys/vm/drop_caches", "3\n", WRITE_STRING_FILE_DISABLE_BUFFER);
         if (r < 0)
                 log_warning_errno(r, "Failed to drop caches, ignoring: %m");
         else