From: Daniel Rosenberg Date: Wed, 12 Jul 2017 00:59:55 +0000 (-0700) Subject: Check if sdcard daemon exited. X-Git-Tag: android-x86-9.0-r1~103^2 X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=1d79d1014e481c92c3f802bbaf174409d191571f;p=android-x86%2Fsystem-vold.git Check if sdcard daemon exited. If the system is using sdcardfs, the sdcard daemon exits after mounting. If it's using FUSE, the sdcard daemon runs until we go to unmount. Bug: 37638548 Test: Run "adb shell ps | grep -w Z" with sdcardfs enabled. The sdcard daemon should not be listed. Run again with sdcardfs disabled. The daemon should be running, and vold should not be stuck waiting on it. Change-Id: I930d22b35194ec99e7a6a4a022a04d36f4f39a34 --- diff --git a/EmulatedVolume.cpp b/EmulatedVolume.cpp index 44ad22a..df91904 100644 --- a/EmulatedVolume.cpp +++ b/EmulatedVolume.cpp @@ -103,6 +103,8 @@ status_t EmulatedVolume::doMount() { LOG(VERBOSE) << "Waiting for FUSE to spin up..."; usleep(50000); // 50ms } + /* sdcardfs will have exited already. FUSE will still be running */ + TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, WNOHANG)); return OK; } diff --git a/PublicVolume.cpp b/PublicVolume.cpp index 119d92c..f976c4a 100644 --- a/PublicVolume.cpp +++ b/PublicVolume.cpp @@ -190,6 +190,8 @@ status_t PublicVolume::doMount() { LOG(VERBOSE) << "Waiting for FUSE to spin up..."; usleep(50000); // 50ms } + /* sdcardfs will have exited already. FUSE will still be running */ + TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, WNOHANG)); return OK; }