Merge "e4crypt_is_native has been moved into system/extras." into nyc-dev am: cfa03d4a4c
am: 269bdbcab1
* commit '269bdbcab18aa8c24a637937d885c045f408a12e':
e4crypt_is_native has been moved into system/extras.
Change-Id: I7f08893a1e21891d35578180cbb66a4db2d91c15
diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
index 4e89575..8786c09 100644
--- a/Ext4Crypt.cpp
+++ b/Ext4Crypt.cpp
@@ -168,6 +168,14 @@
}
LOG(DEBUG) << "Added key " << key_id << " (" << ref << ") to keyring " << device_keyring
<< " in process " << getpid();
+
+ // *TODO* Remove this code when kernel is fixed - see b/28373400
+ // Kernel preserves caches across a key insertion with ext4ice, which leads
+ // to contradictory dirents
+ if (!android::base::WriteStringToFile("3", "/proc/sys/vm/drop_caches")) {
+ PLOG(ERROR) << "Failed to drop_caches";
+ }
+
return true;
}