From: Daan De Meyer Date: Sun, 1 Oct 2023 18:40:45 +0000 (+0200) Subject: mount: Log when we can't create the mount point X-Git-Tag: v255-rc1~368 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce427d0e73667e1b125c82c5c77f98dd9fbe561d;p=thirdparty%2Fsystemd.git mount: Log when we can't create the mount point Debugging mount unit failures caused by systemd not being able to create the mount point is currently rather hard. Let's log about failures to create mount points to simplify debugging. --- diff --git a/src/core/mount.c b/src/core/mount.c index 17925f50d90..55e0c2ec886 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1169,9 +1169,11 @@ static void mount_enter_mounting(Mount *m) { } if (source_is_dir) - (void) mkdir_p_label(m->where, m->directory_mode); + r = mkdir_p_label(m->where, m->directory_mode); else - (void) touch_file(m->where, /* parents = */ true, USEC_INFINITY, UID_INVALID, GID_INVALID, MODE_INVALID); + r = touch_file(m->where, /* parents = */ true, USEC_INFINITY, UID_INVALID, GID_INVALID, MODE_INVALID); + if (r < 0 && r != -EEXIST) + log_unit_warning_errno(UNIT(m), r, "Failed to create mount point '%s', ignoring: %m", m->where); if (source_is_dir) unit_warn_if_dir_nonempty(UNIT(m), m->where);