From d21e516def1dde01bd3a5bcced9913442d88f6c5 Mon Sep 17 00:00:00 2001 From: Shikha Malhotra Date: Wed, 2 Feb 2022 13:43:39 +0000 Subject: Enable ProjectID by default. This is in conjunction with enabling the project id for internal directories. The check whether project ids should be used or not, is done in installd process. If they cannot be used, then the installd process falls back to previous approaches. Bug: b/215154615 Test: atest installd/StorageHostTest Test: atest installd/installd_service_test.cpp Change-Id: I9a45a14cf10c040f7ce84f78c5e9c8ce60c17958 --- recovery_utils/roots.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/recovery_utils/roots.cpp b/recovery_utils/roots.cpp index 7fe385b5e..5c95cba07 100644 --- a/recovery_utils/roots.cpp +++ b/recovery_utils/roots.cpp @@ -154,11 +154,9 @@ int format_volume(const std::string& volume, const std::string& directory) { } bool needs_casefold = false; - bool needs_projid = false; if (volume == "/data") { needs_casefold = android::base::GetBoolProperty("external_storage.casefold.enabled", false); - needs_projid = android::base::GetBoolProperty("external_storage.projid.enabled", false); } int64_t length = 0; @@ -202,11 +200,10 @@ int format_volume(const std::string& volume, const std::string& directory) { "/system/bin/mke2fs", "-F", "-t", "ext4", "-b", std::to_string(kBlockSize), }; - // Project ID's require wider inodes. The Quotas themselves are enabled by tune2fs on boot. - if (needs_projid) { - mke2fs_args.push_back("-I"); - mke2fs_args.push_back("512"); - } + // Following is added for Project ID's quota as they require wider inodes. + // The Quotas themselves are enabled by tune2fs on boot. + mke2fs_args.push_back("-I"); + mke2fs_args.push_back("512"); if (v->fs_mgr_flags.ext_meta_csum) { mke2fs_args.push_back("-O"); @@ -255,10 +252,10 @@ int format_volume(const std::string& volume, const std::string& directory) { "-g", "android", }; - if (needs_projid) { - make_f2fs_cmd.push_back("-O"); - make_f2fs_cmd.push_back("project_quota,extra_attr"); - } + + make_f2fs_cmd.push_back("-O"); + make_f2fs_cmd.push_back("project_quota,extra_attr"); + if (needs_casefold) { make_f2fs_cmd.push_back("-O"); make_f2fs_cmd.push_back("casefold"); -- cgit v1.2.3