From c82c9ce18c2a9959530dd4b6121eb4521c751d81 Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Wed, 24 Jun 2015 13:30:45 -0700 Subject: [PATCH] Make sure volume is vfat before fsck'ing. Bug 21948137 Change-Id: I6843423fd8809d9e2f352059a810aa17dd83b3e3 --- PublicVolume.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PublicVolume.cpp b/PublicVolume.cpp index 9d6887d..d17853b 100644 --- a/PublicVolume.cpp +++ b/PublicVolume.cpp @@ -94,6 +94,11 @@ status_t PublicVolume::doMount() { // TODO: expand to support mounting other filesystems readMetadata(); + if (mFsType != "vfat") { + LOG(ERROR) << getId() << " unsupported filesystem " << mFsType; + return -EIO; + } + if (vfat::Check(mDevPath)) { LOG(ERROR) << getId() << " failed filesystem check"; return -EIO;