Only enable quotas when supported by device.
Otherwise we might end up creating ext4 partitions that the device
can't mount.
Bug: 63763609
Test: builds, boots
Exempt-From-Owner-Approval: Bug 63673347
Change-Id: I5f6cf73f23a55bc0dea9480523f19049313c3dd1
diff --git a/fs/Ext4.cpp b/fs/Ext4.cpp
index adb8f2e..0cf4f9e 100644
--- a/fs/Ext4.cpp
+++ b/fs/Ext4.cpp
@@ -38,6 +38,7 @@
#define LOG_TAG "Vold"
#include <android-base/logging.h>
+#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <cutils/log.h>
#include <cutils/properties.h>
@@ -176,7 +177,10 @@
cmd.push_back("-M");
cmd.push_back(target);
- std::string options("has_journal,quota");
+ std::string options("has_journal");
+ if (android::base::GetBoolProperty("vold.has_quota", false)) {
+ options += ",quota";
+ }
if (e4crypt_is_native()) {
options += ",encrypt";
}