AppFuseUtil: Call ForceUnmount before PrepareDir.

am: 15ad33a8b1

Change-Id: I39e24afab685cfbdcc492d135937bb2e34110818
gugelfrei
Narayan Kamath 5 years ago committed by android-build-merger
commit b553c62bf1

@ -49,9 +49,6 @@ static android::status_t GetMountPath(uid_t uid, const std::string& name, std::s
}
static android::status_t Mount(int device_fd, const std::string& path) {
// Remove existing mount.
android::vold::ForceUnmount(path);
const auto opts = StringPrintf(
"fd=%i,"
"rootmode=40000,"
@ -115,6 +112,11 @@ int MountAppFuse(uid_t uid, int mountId, android::base::unique_fd* device_fd) {
return -1;
}
// Forcibly remove the existing mount before we attempt to prepare the
// directory. If we have a dangling mount, then PrepareDir may fail if the
// indirection to FUSE doesn't work.
android::vold::ForceUnmount(path);
// Create directories.
const android::status_t result = android::vold::PrepareDir(path, 0700, 0, 0);
if (result != android::OK) {

Loading…
Cancel
Save