@@ -2595,6 +2595,8 @@ binder::Status InstalldNativeService::invalidateMounts() {
25952595 std::getline (in, ignored);
25962596
25972597 if (android::base::GetBoolProperty (kFuseProp , false )) {
2598+ // TODO(b/146139106): Use sdcardfs mounts on devices running sdcardfs so we don't bypass
2599+ // it's VFS cache
25982600 if (target.compare (0 , 17 , " /mnt/pass_through" ) == 0 ) {
25992601 LOG (DEBUG ) << " Found storage mount " << source << " at " << target;
26002602 mStorageMounts [source] = target;
@@ -2616,6 +2618,17 @@ std::string InstalldNativeService::findDataMediaPath(
26162618 std::lock_guard<std::recursive_mutex> lock (mMountsLock );
26172619 const char * uuid_ = uuid ? uuid->c_str () : nullptr ;
26182620 auto path = StringPrintf (" %s/media" , create_data_path (uuid_).c_str ());
2621+ if (android::base::GetBoolProperty (kFuseProp , false )) {
2622+ // TODO(b/146139106): This is only safe on devices not running sdcardfs where there is no
2623+ // risk of bypassing the sdcardfs VFS cache
2624+
2625+ // Always use the lower filesystem path on FUSE enabled devices not running sdcardfs
2626+ // The upper filesystem path, /mnt/pass_through/<userid>/<vol>/ which was a bind mount
2627+ // to the lower filesytem may have been unmounted already when a user is
2628+ // removed and the path will now be pointing to a tmpfs without content
2629+ return StringPrintf (" %s/%u" , path.c_str (), userid);
2630+ }
2631+
26192632 auto resolved = mStorageMounts [path];
26202633 if (resolved.empty ()) {
26212634 LOG (WARNING ) << " Failed to find storage mount for " << path;
0 commit comments