Merge "Add persist.sys.fuse.bpf.override" am: c4bc218452

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2355603

Change-Id: Ia2f439eb4761fa6f765e05e430b444b9dbd7f2b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Paul Lawrence 2022-12-16 17:23:15 +00:00 committed by Automerger Merge Worker
commit 146112e660
3 changed files with 11 additions and 8 deletions

View file

@ -1774,7 +1774,15 @@ std::pair<android::base::unique_fd, std::string> OpenDirInProcfs(std::string_vie
bool IsFuseBpfEnabled() {
// TODO Once kernel supports flag, trigger off kernel flag unless
// ro.fuse.bpf.enabled is explicitly set to false
if (base::GetBoolProperty("ro.fuse.bpf.enabled", false)) {
bool enabled;
if (base::GetProperty("ro.fuse.bpf.is_running", "") != "")
enabled = base::GetBoolProperty("ro.fuse.bpf.is_running", false);
else if (base::GetProperty("persist.sys.fuse.bpf.override", "") != "")
enabled = base::GetBoolProperty("persist.sys.fuse.bpf.override", false);
else
enabled = base::GetBoolProperty("ro.fuse.bpf.enabled", false);
if (enabled) {
base::SetProperty("ro.fuse.bpf.is_running", "true");
return true;
} else {

View file

@ -50,7 +50,6 @@ EmulatedVolume::EmulatedVolume(const std::string& rawPath, int userId)
mRawPath = rawPath;
mLabel = "emulated";
mFuseMounted = false;
mFuseBpfEnabled = IsFuseBpfEnabled();
mUseSdcardFs = IsSdcardfsUsed();
mAppDataIsolationEnabled = base::GetBoolProperty(kVoldAppDataIsolationEnabled, false);
}
@ -62,7 +61,6 @@ EmulatedVolume::EmulatedVolume(const std::string& rawPath, dev_t device, const s
mRawPath = rawPath;
mLabel = fsUuid;
mFuseMounted = false;
mFuseBpfEnabled = IsFuseBpfEnabled();
mUseSdcardFs = IsSdcardfsUsed();
mAppDataIsolationEnabled = base::GetBoolProperty(kVoldAppDataIsolationEnabled, false);
}
@ -446,7 +444,7 @@ status_t EmulatedVolume::doMount() {
}
}
if (!mFuseBpfEnabled) {
if (!IsFuseBpfEnabled()) {
// Only do the bind-mounts when we know for sure the FUSE daemon can resolve the path.
res = mountFuseBindMounts();
if (res != OK) {
@ -505,7 +503,7 @@ status_t EmulatedVolume::doUnmount() {
if (mFuseMounted) {
std::string label = getLabel();
if (!mFuseBpfEnabled) {
if (!IsFuseBpfEnabled()) {
// Ignoring unmount return status because we do want to try to
// unmount the rest cleanly.
unmountFuseBindMounts();

View file

@ -66,9 +66,6 @@ class EmulatedVolume : public VolumeBase {
/* Whether we mounted FUSE for this volume */
bool mFuseMounted;
/* Whether the FUSE BPF feature is enabled */
bool mFuseBpfEnabled;
/* Whether to use sdcardfs for this volume */
bool mUseSdcardFs;