]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
add error message when bind mount src missing
authorAlan Perry <alaperry@microsoft.com>
Fri, 26 Jun 2020 05:37:39 +0000 (05:37 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 7 Jul 2020 18:04:19 +0000 (20:04 +0200)
src/core/mount.c
src/core/namespace.c

index 8b30a4db6a98770d0cbb0792151c46bbd7dd0b80..337e94e90e40fab47ab4a166db38f9ae730098ee 100644 (file)
@@ -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;
index 93e077ce6fb7ce1d8d6d69b0fda4987caaaa05d4..b2bbcf58f2dafb29231270242bab52679fadae94 100644 (file)
@@ -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));