diff options
authorVolker Hilsheimer <>2019-06-18 23:03:01 +0200
committerVolker Hilsheimer <>2019-06-18 23:03:01 +0200
commit6275e037bfe532d12ecd76913d5d36a91c1d5034 (patch)
parentcdfe8c76af1518ccdd497c20ecc189365c733879 (diff)
Android: Make sure that the root file system is in the list of volumes
On Android (at least in the emulator), the root file system is reported to be of type rootfs, which we usually ignore on Linux as legacy. Also, it's a read-only file system with bytesTotal reported as zero. We usually ignore such volumes, but as the root file system is expected to be in the list, we should never ignore it. This fixes the failing QStorageInfo test. Change-Id: I778ee9e76e385649e58d5e5ac7e0ae2d8e0ba92b Fixes: QTBUG-73563 Reviewed-by: Thiago Macieira <> Reviewed-by: BogDan Vatra <>
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index b7621b5d2f..6b821b0fe9 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -220,7 +220,7 @@ static bool shouldIncludeFs(const QStorageIterator &it)
return false;
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
if (it.fileSystemType() == "rootfs")
return false;
@@ -846,7 +846,7 @@ QList<QStorageInfo> QStorageInfoPrivate::mountedVolumes()
const QString mountDir = it.rootPath();
QStorageInfo info(mountDir);
- if (info.bytesTotal() == 0)
+ if (info.bytesTotal() == 0 && info != root())