From d764fe5891d6518e3ed130410a4d0276405aacf6 Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Sun, 26 Mar 2017 00:47:42 +0800 Subject: [PATCH] vold3: check supported filesystem modules If there is a filesystem module of the requested type, it should be considered supported. Note the kernel will auto load the filesystem module on mounting by modprobe. --- Utils.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Utils.cpp b/Utils.cpp index cc66101..1856f6b 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -542,7 +543,15 @@ bool IsFilesystemSupported(const std::string& fsType) { supported.append("fuse\tntfs\n" "fuse\texfat\n"); - return supported.find(fsType + "\n") != std::string::npos; + if (supported.find(fsType + "\n") != std::string::npos) { + return true; + } + + // Check if there is a filesystem module available + char fs[PATH_MAX]; + get_default_mod_path(fs); + supported = StringPrintf("%skernel/fs/%s", fs, fsType.c_str()); + return !access(supported.c_str(), F_OK); } status_t WipeBlockDevice(const std::string& path) { -- 2.11.0