summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Zim <zezeozue@google.com> 2019-11-04 16:07:21 +0000
committer Zim <zezeozue@google.com> 2019-11-05 10:32:55 +0000
commit8cee50121ed46d62834a0effbac31a47680c2049 (patch)
treeb7bf199ae9b35879250340f2a49943be873a44be
parente4d836a41fd9285c9f9707a56ef07eefb537c962 (diff)
Use /data/media path when migrating legacy OBB data
The MediaProvider process is running as the FUSE daemon and is handling IO requests from the kernel on /sdcard. Accessing a path on /sdcard can hang forever if the daemon is not responding. At user 0 startup (boot), the system_server waits for migration of OBB data and it can deadlock if the FUSE daemon is not running. To break this cyclic dependency between the FUSE daemon and the system_server, we now migrate OBB using /data/media instead of /sdcard, thereby bypassing the FUSE daemon. Test: adb shell sm set-virtual-disk true && adb shell sm partition disk:7,112 private && adb reboot && adb shell ls /sdcard Bug: 135341433 Change-Id: Ib64f7eb7608704e1b53a1b923cc068172fe05e1c
-rw-r--r--cmds/installd/migrate_legacy_obb_data.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/cmds/installd/migrate_legacy_obb_data.sh b/cmds/installd/migrate_legacy_obb_data.sh
index 10756881be..0e6d7b9c62 100644
--- a/cmds/installd/migrate_legacy_obb_data.sh
+++ b/cmds/installd/migrate_legacy_obb_data.sh
@@ -15,17 +15,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-rm -rf /sdcard/Android/obb/test_probe
-mkdir -p /sdcard/Android/obb/
-touch /sdcard/Android/obb/test_probe
+rm -rf /data/media/Android/obb/test_probe
+mkdir -p /data/media/Android/obb/
+touch /data/media/Android/obb/test_probe
if ! test -f /data/media/0/Android/obb/test_probe ; then
log -p i -t migrate_legacy_obb_data "No support for 'unshared_obb'. Not migrating"
- rm -rf /sdcard/Android/obb/test_probe
+ rm -rf /data/media/Android/obb/test_probe
exit 0
fi
# Delete the test file, and remove the obb folder if it is empty
-rm -rf /sdcard/Android/obb/test_probe
+rm -rf /data/media/Android/obb/test_probe
rmdir /data/media/obb
if ! test -d /data/media/obb ; then