OSDN Git Service

Don't LOG() after fork() and before exec().
authorMartijn Coenen <maco@google.com>
Wed, 4 Dec 2019 14:48:42 +0000 (15:48 +0100)
committerMartijn Coenen <maco@google.com>
Wed, 4 Dec 2019 14:50:29 +0000 (15:50 +0100)
LOG() can hang, because another vold thread may have been holding
a libc lock at the time we forked. Simply moving the log line to
before the fork().

Bug: 135341433
Test: atest AdoptableHostTest
Change-Id: I6063eb33f35c835a226bc1e56de97ace426747ff

model/EmulatedVolume.cpp

index 8224e61..eb6b8a3 100644 (file)
@@ -115,8 +115,8 @@ status_t EmulatedVolume::doMount() {
         return OK;
     }
 
+    LOG(INFO) << "Executing sdcardfs";
     if (!(mFusePid = fork())) {
-        LOG(INFO) << "Executing sdcardfs";
         // clang-format off
         if (execl(kFusePath, kFusePath,
                 "-u", "1023", // AID_MEDIA_RW