From 3d9896226933fbf61c5af84784a3a1cc69ac24f6 Mon Sep 17 00:00:00 2001 From: Tao Wu Date: Thu, 6 Aug 2020 19:31:21 -0700 Subject: [PATCH] Don't abort fuse connections for virtiofs. Android should only abort fuse connections for fuse fs. It shouldn't touch fuse connections for virtiofs. Bug: 162284193 Test: manual - Restart zygote, no 'Transport endpoint is not connected' error. Change-Id: Ie3536734531404e98ad1b6594ab3c52e919b22b7 --- Utils.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Utils.cpp b/Utils.cpp index f9f3058..17fee28 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -1442,6 +1442,17 @@ status_t AbortFuseConnections() { namespace fs = std::filesystem; for (const auto& itEntry : fs::directory_iterator("/sys/fs/fuse/connections")) { + std::string fsPath = itEntry.path().string() + "/filesystem"; + std::string fs; + + // Virtiofs is on top of fuse and there isn't any user space daemon. + // Android user space doesn't manage it. + if (android::base::ReadFileToString(fsPath, &fs, false) && + android::base::Trim(fs) == "virtiofs") { + LOG(INFO) << "Ignore virtiofs connection entry " << itEntry.path().string(); + continue; + } + std::string abortPath = itEntry.path().string() + "/abort"; LOG(DEBUG) << "Aborting fuse connection entry " << abortPath; bool ret = writeStringToFile("1", abortPath);