Merge "Disable bind mounts for data and obb if FUSE BPF is available" am: b9f8aefbb9
am: f0bde5767c
Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1907695 Change-Id: I18dd4137d5140765bd3607e8ca7aa5fd0d403154
This commit is contained in:
commit
be440e1227
3 changed files with 17 additions and 7 deletions
1
Utils.h
1
Utils.h
|
@ -36,6 +36,7 @@ namespace vold {
|
|||
|
||||
static const char* kVoldAppDataIsolationEnabled = "persist.sys.vold_app_data_isolation_enabled";
|
||||
static const char* kExternalStorageSdcardfs = "external_storage.sdcardfs.enabled";
|
||||
static const char* kFuseBpfEnabled = "persist.sys.fuse.bpf.enable";
|
||||
|
||||
/* SELinux contexts used depending on the block device type */
|
||||
extern char* sBlkidContext;
|
||||
|
|
|
@ -49,6 +49,7 @@ EmulatedVolume::EmulatedVolume(const std::string& rawPath, int userId)
|
|||
mRawPath = rawPath;
|
||||
mLabel = "emulated";
|
||||
mFuseMounted = false;
|
||||
mFuseBpfEnabled = base::GetBoolProperty(kFuseBpfEnabled, false);
|
||||
mUseSdcardFs = IsSdcardfsUsed();
|
||||
mAppDataIsolationEnabled = base::GetBoolProperty(kVoldAppDataIsolationEnabled, false);
|
||||
}
|
||||
|
@ -60,6 +61,7 @@ EmulatedVolume::EmulatedVolume(const std::string& rawPath, dev_t device, const s
|
|||
mRawPath = rawPath;
|
||||
mLabel = fsUuid;
|
||||
mFuseMounted = false;
|
||||
mFuseBpfEnabled = base::GetBoolProperty(kFuseBpfEnabled, false);
|
||||
mUseSdcardFs = IsSdcardfsUsed();
|
||||
mAppDataIsolationEnabled = base::GetBoolProperty(kVoldAppDataIsolationEnabled, false);
|
||||
}
|
||||
|
@ -359,10 +361,12 @@ status_t EmulatedVolume::doMount() {
|
|||
}
|
||||
}
|
||||
|
||||
// Only do the bind-mounts when we know for sure the FUSE daemon can resolve the path.
|
||||
res = mountFuseBindMounts();
|
||||
if (res != OK) {
|
||||
return res;
|
||||
if (!mFuseBpfEnabled) {
|
||||
// Only do the bind-mounts when we know for sure the FUSE daemon can resolve the path.
|
||||
res = mountFuseBindMounts();
|
||||
if (res != OK) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
ConfigureReadAheadForFuse(GetFuseMountPathForUser(user_id, label), 256u);
|
||||
|
@ -416,9 +420,11 @@ status_t EmulatedVolume::doUnmount() {
|
|||
if (mFuseMounted) {
|
||||
std::string label = getLabel();
|
||||
|
||||
// Ignoring unmount return status because we do want to try to unmount
|
||||
// the rest cleanly.
|
||||
unmountFuseBindMounts();
|
||||
if (!mFuseBpfEnabled) {
|
||||
// Ignoring unmount return status because we do want to try to
|
||||
// unmount the rest cleanly.
|
||||
unmountFuseBindMounts();
|
||||
}
|
||||
|
||||
if (UnmountUserFuse(userId, getInternalPath(), label) != OK) {
|
||||
PLOG(INFO) << "UnmountUserFuse failed on emulated fuse volume";
|
||||
|
|
|
@ -64,6 +64,9 @@ 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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue