Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

system-vold: Commit

system/vold


Commit MetaInfo

Révision822b459cf79074855b8237e0550941ca55a087ce (tree)
l'heure2020-06-01 20:30:29
AuteurChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Message de Log

Allow mounting a read-only exFAT file system

If exfat::Check() fails, re-check the file system in read-only mode.
The logic is similar to exfat::Mount().

Change Summary

Modification

--- a/fs/Exfat.cpp
+++ b/fs/Exfat.cpp
@@ -42,17 +42,18 @@ bool IsSupported() {
4242 status_t Check(const std::string& source) {
4343 std::vector<std::string> cmd;
4444 cmd.push_back(kFsckPath);
45+ cmd.push_back("-a");
4546 cmd.push_back(source);
4647
4748 int rc = ForkExecvp(cmd, sFsckUntrustedContext);
4849 if (rc == 0) {
4950 LOG(INFO) << "Check OK";
5051 return 0;
51- } else {
52- LOG(ERROR) << "Check failed (code " << rc << ")";
53- errno = EIO;
54- return -1;
5552 }
53+
54+ // don't write anything to the file system
55+ cmd[1] = "-n";
56+ return ForkExecvp(cmd, sFsckUntrustedContext);
5657 }
5758
5859 status_t Mount(const std::string& source, const std::string& target, int ownerUid, int ownerGid,
Afficher sur ancien navigateur de dépôt.