From 133c414b6df0654ae2d38f44240d0c3a74c851e6 Mon Sep 17 00:00:00 2001 From: nyyu Date: Sun, 8 Jan 2023 11:37:40 +0100 Subject: [PATCH] vold: add option ^metadata_csum Change-Id: I1fe379967968e4be8973e98c4fcb9b5c95bb60e8 --- Utils.cpp | 2 +- fs/Ext4.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Utils.cpp b/Utils.cpp index a7e85f2..9ffc1dd 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -644,7 +644,7 @@ static status_t readMetadata(const std::string& path, std::string* fsType, std:: cmd.push_back(path); std::vector output; - status_t res = ForkExecvp(cmd, &output, untrusted ? sBlkidUntrustedContext : sBlkidContext); + status_t res = ForkExecvp(cmd, &output/*, untrusted ? sBlkidUntrustedContext : sBlkidContext*/); if (res != OK) { LOG(WARNING) << "blkid failed to identify " << path; return res; diff --git a/fs/Ext4.cpp b/fs/Ext4.cpp index 0ae5cb3..73971e1 100644 --- a/fs/Ext4.cpp +++ b/fs/Ext4.cpp @@ -184,19 +184,22 @@ status_t Format(const std::string& source, unsigned long numSectors, const std:: cmd.push_back("-t"); cmd.push_back("ext4"); + cmd.push_back("-m"); + cmd.push_back("0"); + cmd.push_back("-M"); cmd.push_back(target); bool needs_casefold = android::base::GetBoolProperty("external_storage.casefold.enabled", false); - bool needs_projid = true; + bool needs_projid = false; if (needs_projid) { cmd.push_back("-I"); cmd.push_back("512"); } - std::string options("has_journal"); + std::string options("has_journal,^metadata_csum"); if (android::base::GetBoolProperty("vold.has_quota", false)) { options += ",quota"; }