summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2022-08-17 08:03:20 -0400
committercobackporter[bot] <cobackporter[bot]@users.noreply.github.com>2022-08-17 19:31:40 +0000
commite260cfc211ec8a0ff96c5c7e60913e5971f22c69 (patch)
tree6cf8cd4669218bdb005364b7f43f0e3c5ff77151
parentFix UI Selection bug (diff)
downloadonline-e260cfc211ec8a0ff96c5c7e60913e5971f22c69.tar.gz
online-e260cfc211ec8a0ff96c5c7e60913e5971f22c69.zip
wsd: log unmount errors only when mounting is enabled backport/5160/distro/collabora/co-21-11
When bind-mounting is disabled, we do a best-effort to unmount any lingering mount-points. This is a cleanup that helps with leftovers. Here, we do a debug log level in case the unmounting fails, and error, otherwise, when bind-mounting is enabled. Change-Id: I199d6234aebfd84e6be812e5b7d3758273086815 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
-rw-r--r--common/JailUtil.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/common/JailUtil.cpp b/common/JailUtil.cpp
index 8b523783ae..a4947aa018 100644
--- a/common/JailUtil.cpp
+++ b/common/JailUtil.cpp
@@ -68,7 +68,17 @@ static bool unmount(const std::string& target)
if (res)
LOG_TRC("Unmounted [" << target << "] successfully.");
else
- LOG_ERR("Failed to unmount [" << target << ']');
+ {
+ // If bind-mounting is enabled, noisily log failures.
+ // Otherwise, it's a cleanup attempt of earlier mounts,
+ // which may be left-over and now the config has changed.
+ // This happens more often in dev labs than in prod.
+ if (JailUtil::isBindMountingEnabled())
+ LOG_ERR("Failed to unmount [" << target << ']');
+ else
+ LOG_DBG("Failed to unmount [" << target << ']');
+ }
+
return res;
}