1cd6c6c69e
Linux allows admins to mount new filesystems over non-empty paths (though I managed to do so on FreeBSD and macOS too), so we must find the most recent mount that applies to this path instead of the longest matching mountpoint. We do that by scanning the /proc/self/mountinfo list backwards and thus any matching isParentOf() must be the correct one. # mkdir -p /tmp/foo/bar # mount -t tmpfs tmpfs /tmp/foo/bar # mount -t tmpfs -o size=1M tmpfs /tmp/foo $ ./tests/manual/qstorageinfo/qstorageinfo /tmp/foo/bar Filesystem (Type) Size Available BSize Label Mounted on tmpfs RW 1024 1024 4096 /tmp/foo But we must guard against an earlier mount still being (somehow) accessible. We've seen this in the CI, where /run is earlier than / but still somehow accessible -- I guess this is one or a pair of mount --move. An additional benefit is that don't even attempt to compare to the virtual filesystems mounted by the system early after boot, if what we're looking for isn't the root. See next commit for a fix for QStorageInfo::mountedVolumes(). Change-Id: I79e700614d034281bf55fffd178f8befc5e80edb Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> |
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
LICENSES | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
qt_cmdline.cmake |