summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerry Fan <gfan@google.com>2019-07-12 17:11:23 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-07-12 17:11:23 +0000
commitff7da227dbe0f52d3eb9a3791cd19af99efda302 (patch)
tree234fa7b3d82790b0fec20b84e5c1622d3216ad2d
parent346c17bbc9d47cedfc3a1887940e6f1ea9514614 (diff)
parent997a2d93d7a9216c248be9c983adec2d91283f5a (diff)
downloadcore-ff7da227dbe0f52d3eb9a3791cd19af99efda302.tar.gz
Merge "Revert "Revert "rootdir / sdcard : Stop creating /data/media/obb.""" into qt-dev
-rw-r--r--rootdir/init.rc1
-rw-r--r--sdcard/sdcard.cpp9
2 files changed, 8 insertions, 2 deletions
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 893998cee..c042c4897 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -589,7 +589,6 @@ on post-fs-data
symlink /data/data /data/user/0
mkdir /data/media 0770 media_rw media_rw
- mkdir /data/media/obb 0770 media_rw media_rw
mkdir /data/cache 0770 system cache
mkdir /data/cache/recovery 0770 system cache
diff --git a/sdcard/sdcard.cpp b/sdcard/sdcard.cpp
index 2b358197a..0acea7266 100644
--- a/sdcard/sdcard.cpp
+++ b/sdcard/sdcard.cpp
@@ -214,7 +214,14 @@ static void run_sdcardfs(const std::string& source_path, const std::string& labe
if (multi_user) {
std::string obb_path = source_path + "/obb";
- fs_prepare_dir(obb_path.c_str(), 0775, uid, gid);
+ // Only attempt to prepare the /obb dir if it already exists. We want
+ // the legacy obb path "/data/media/obb" to be fixed up so that we can
+ // migrate it to its new location, but we don't want the directory to be
+ // created if it doesn't already exist.
+ struct stat sb;
+ if (TEMP_FAILURE_RETRY(lstat(obb_path.c_str(), &sb)) == 0) {
+ fs_prepare_dir(obb_path.c_str(), 0775, uid, gid);
+ }
}
exit(0);