Merge "Unmount public sdcard filesystems before killing the fuse process." into nyc-dev am: a4330be

am: c1428a5

* commit 'c1428a51c3d343814e683e2e9864a5cfee6836a0':
  Unmount public sdcard filesystems before killing the fuse process.

Change-Id: I0b24d5c73deb67764092f7934c72ec48937e5286
gugelfrei
John Cormie 8 years ago committed by android-build-merger
commit 5c0ed69d96

@ -194,12 +194,10 @@ status_t PublicVolume::doMount() {
}
status_t PublicVolume::doUnmount() {
if (mFusePid > 0) {
kill(mFusePid, SIGTERM);
TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, 0));
mFusePid = 0;
}
// Unmount the storage before we kill the FUSE process. If we kill
// the FUSE process first, most file system operations will return
// ENOTCONN until the unmount completes. This is an exotic and unusual
// error code and might cause broken behaviour in applications.
KillProcessesUsingPath(getPath());
ForceUnmount(kAsecPath);
@ -209,6 +207,12 @@ status_t PublicVolume::doUnmount() {
ForceUnmount(mFuseWrite);
ForceUnmount(mRawPath);
if (mFusePid > 0) {
kill(mFusePid, SIGTERM);
TEMP_FAILURE_RETRY(waitpid(mFusePid, nullptr, 0));
mFusePid = 0;
}
rmdir(mFuseDefault.c_str());
rmdir(mFuseRead.c_str());
rmdir(mFuseWrite.c_str());

Loading…
Cancel
Save