From 5dc60faae58b9e0b7b916888ad88656d269cf9d0 Mon Sep 17 00:00:00 2001 From: Alan Perry Date: Fri, 26 Jun 2020 05:37:39 +0000 Subject: [PATCH] add error message when bind mount src missing --- src/core/mount.c | 7 +++++-- src/core/namespace.c | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/core/mount.c b/src/core/mount.c index 8b30a4db6a..337e94e90e 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1017,8 +1017,11 @@ static void mount_enter_mounting(Mount *m) { /* Create the source directory for bind-mounts if needed */ p = get_mount_parameters_fragment(m); - if (p && mount_is_bind(p)) - (void) mkdir_p_label(p->what, m->directory_mode); + if (p && mount_is_bind(p)) { + r = mkdir_p_label(p->what, m->directory_mode); + if (r < 0) + log_unit_error_errno(UNIT(m), r, "Failed to make bind mount source '%s': %m", p->what); + } if (p) { _cleanup_free_ char *opts = NULL; diff --git a/src/core/namespace.c b/src/core/namespace.c index 93e077ce6f..b2bbcf58f2 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -1034,7 +1034,7 @@ static int apply_mount( /* Hmm, either the source or the destination are missing. Let's see if we can create the destination, then try again */ if (stat(what, &st) < 0) - log_debug_errno(errno, "Mount point source '%s' is not accessible: %m", what); + log_error_errno(errno, "Mount point source '%s' is not accessible: %m", what); else { int q; @@ -1046,7 +1046,7 @@ static int apply_mount( q = touch(mount_entry_path(m)); if (q < 0) - log_debug_errno(q, "Failed to create destination mount point node '%s': %m", mount_entry_path(m)); + log_error_errno(q, "Failed to create destination mount point node '%s': %m", mount_entry_path(m)); else try_again = true; } @@ -1060,7 +1060,7 @@ static int apply_mount( } if (r < 0) - return log_debug_errno(r, "Failed to mount %s to %s: %m", what, mount_entry_path(m)); + return log_error_errno(r, "Failed to mount %s to %s: %m", what, mount_entry_path(m)); } log_debug("Successfully mounted %s to %s", what, mount_entry_path(m)); -- 2.25.1