platform_system_vold/tests
Eric Biggers fec0c0e472 Add syncs when creating parent directories
vold creates some directories for storing encryption keys if they don't
already exist, potentially including parent directories:

    /metadata/vold/metadata_encryption
    /data/misc/vold/volume_keys/$volume_uuid
    /data/misc_de/$user/vold/volume_keys/$volume_uuid
    /data/misc_ce/$user/vold/volume_keys/$volume_uuid

Currently fs_mkdirs() is used for this.  However, fs_mkdirs() doesn't
include the fsync()s of the parent directories that are needed to ensure
that the new directories are persisted to disk right away -- which is
important for encryption keys.

Add a utility function MkdirsSync() which does what is needed, and make
the appropriate places call it.

Test: Booted and checked log for "Created directory" message.
      Also ran 'atest vold_tests' to run the new unit test.
Change-Id: Ie9917b616433080139b8db3fd6877203ee6faf77
2021-02-16 16:18:53 -08:00
..
Android.bp [LSC] Add LOCAL_LICENSE_KINDS to system/vold 2021-02-14 10:37:25 -08:00
cryptfs_test.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
Utils_test.cpp Add syncs when creating parent directories 2021-02-16 16:18:53 -08:00
VoldNativeServiceValidation_test.cpp [vold] Add argument verification to IncFS methods 2020-03-25 14:33:24 -07:00