diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2022-08-17 08:03:20 -0400 |
---|---|---|
committer | thebearon <19438782+thebearon@users.noreply.github.com> | 2022-08-18 01:09:38 +0200 |
commit | d404face4149593b04f239752ee26d8f7c7bc4dd (patch) | |
tree | 6cf8cd4669218bdb005364b7f43f0e3c5ff77151 | |
parent | Fix UI Selection bug (diff) | |
download | online-d404face4149593b04f239752ee26d8f7c7bc4dd.tar.gz online-d404face4149593b04f239752ee26d8f7c7bc4dd.zip |
wsd: log unmount errors only when mounting is enabled
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.cpp | 12 |
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; } |