From d688eab7da83079562ff453600c5e082ebc3bbb9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 17 Jan 2024 08:03:43 -0800 Subject: [PATCH] QStorageInfo/Linux: move retrieveVolumeInfo() up because it won't fail initRootPath() may fail, so let's make sure we do extract some information from the FS even if that does. Issue introduced by 3e330a79ec8d273630660eefae42995018421c0c ("QStorageInfo/Linux: rewrite the label retriever to use device IDs") Task-number: QTBUG-121140 Change-Id: I76ffba14ece04f24b43efffd17ab2df71af8c4e0 Reviewed-by: Edward Welbourne Reviewed-by: Ahmad Samir (cherry picked from commit 264b7a67330fb1a3fd0f896603e75ada46326875) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/io/qstorageinfo_linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qstorageinfo_linux.cpp b/src/corelib/io/qstorageinfo_linux.cpp index 7d8a5a293d3..8d8751db6a2 100644 --- a/src/corelib/io/qstorageinfo_linux.cpp +++ b/src/corelib/io/qstorageinfo_linux.cpp @@ -136,11 +136,11 @@ static inline QString retrieveLabel(const QByteArray &device, quint64 deviceId) void QStorageInfoPrivate::doStat() { + retrieveVolumeInfo(); quint64 deviceId = initRootPath(); if (!deviceId) return; - retrieveVolumeInfo(); name = retrieveLabel(device, deviceId); }