Merge "Use snapshot value sys.fuse_snapshot instead of persist.sys.fuse"
diff --git a/OWNERS b/OWNERS
index 6c5c150..7779c20 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,4 +1,6 @@
jsharkey@android.com
paulcrowley@google.com
paullawrence@google.com
-ebiggers@google.com
\ No newline at end of file
+ebiggers@google.com
+drosen@google.com
+
diff --git a/Utils.cpp b/Utils.cpp
index 5e284b2..e5bf33d 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -1023,7 +1023,8 @@
const int result_int =
TEMP_FAILURE_RETRY(mount("/dev/fuse", path.c_str(), "fuse",
- MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_NOATIME, opts.c_str()));
+ MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_NOATIME | MS_LAZYTIME,
+ opts.c_str()));
if (result_int != 0) {
PLOG(ERROR) << "Failed to mount " << path;
return -errno;
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 5b23116..b0e0b23 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -487,6 +487,9 @@
case VoldNativeService::REMOUNT_MODE_FULL:
mode = "full";
break;
+ case VoldNativeService::REMOUNT_MODE_PASS_THROUGH:
+ mode = "pass_through";
+ break;
default:
PLOG(ERROR) << "Unknown mode " << std::to_string(mountMode);
return -1;
diff --git a/binder/android/os/IVold.aidl b/binder/android/os/IVold.aidl
index b1af587..ae5a3bc 100644
--- a/binder/android/os/IVold.aidl
+++ b/binder/android/os/IVold.aidl
@@ -157,6 +157,7 @@
const int REMOUNT_MODE_LEGACY = 4;
const int REMOUNT_MODE_INSTALLER = 5;
const int REMOUNT_MODE_FULL = 6;
+ const int REMOUNT_MODE_PASS_THROUGH = 7;
const int VOLUME_STATE_UNMOUNTED = 0;
const int VOLUME_STATE_CHECKING = 1;
diff --git a/model/EmulatedVolume.cpp b/model/EmulatedVolume.cpp
index 41f42d1..c84fbb7 100644
--- a/model/EmulatedVolume.cpp
+++ b/model/EmulatedVolume.cpp
@@ -89,13 +89,18 @@
if (isFuse) {
LOG(INFO) << "Mounting emulated fuse volume";
android::base::unique_fd fd;
- int result = MountUserFuse(getMountUserId(), label, &fd);
+ int user_id = getMountUserId();
+ int result = MountUserFuse(user_id, label, &fd);
+
if (result != 0) {
PLOG(ERROR) << "Failed to mount emulated fuse volume";
return -result;
}
setFuseFd(std::move(fd));
- return OK;
+
+ std::string pass_through_path(StringPrintf("/mnt/pass_through/%d/%s",
+ user_id, label.c_str()));
+ return BindMount(getInternalPath(), pass_through_path);
}
if (!(mFusePid = fork())) {
diff --git a/model/PublicVolume.cpp b/model/PublicVolume.cpp
index 3f003a9..7b8a21f 100644
--- a/model/PublicVolume.cpp
+++ b/model/PublicVolume.cpp
@@ -174,13 +174,18 @@
if (isFuse) {
LOG(INFO) << "Mounting public fuse volume";
android::base::unique_fd fd;
- int result = MountUserFuse(getMountUserId(), stableName, &fd);
+ int user_id = getMountUserId();
+ int result = MountUserFuse(user_id, stableName, &fd);
+
if (result != 0) {
LOG(ERROR) << "Failed to mount public fuse volume";
return -result;
}
setFuseFd(std::move(fd));
- return OK;
+
+ std::string pass_through_path(StringPrintf("/mnt/pass_through/%d/%s",
+ user_id, stableName.c_str()));
+ return BindMount(getInternalPath(), pass_through_path);
}
if (!(mFusePid = fork())) {