OSDN Git Service

vold: Also wait for dm device when mounting private volume
authorLuK1337 <priv.luk@gmail.com>
Wed, 14 Mar 2018 13:16:08 +0000 (14:16 +0100)
committerMichael Bestas <mkbestas@lineageos.org>
Sun, 23 Sep 2018 23:23:52 +0000 (02:23 +0300)
* Fixes issue where sometimes adopted storage doesn't
  get mounted on certain devices.

Change-Id: I195bbdd4541bf1e8f373ab8ef18f5e7caefab3f5

model/PrivateVolume.cpp

index ad3de2e..f0adb6c 100644 (file)
@@ -99,6 +99,11 @@ status_t PrivateVolume::doDestroy() {
 }
 
 status_t PrivateVolume::doMount() {
+    if (!WaitForFile(mDmDevPath, 15s)) {
+        PLOG(ERROR) << "Timed out waiting for " << getId();
+        return -EIO;
+    }
+
     if (readMetadata()) {
         LOG(ERROR) << getId() << " failed to read metadata";
         return -EIO;