diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-06-01 22:26:49 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-07-20 17:45:49 +0200 |
commit | 71b879ad15cbd5d76d1006cce44757de780165cd (patch) | |
tree | a7a15fb1c17ba8212002d254fa81392203cebc9d | |
parent | ed9ab6a264d3dfb344b233e32269d46ae83f75d3 (diff) | |
download | systemd-71b879ad15cbd5d76d1006cce44757de780165cd.tar.gz |
mount: be more descriptive when logging about overly long mount point paths
This is prompted by #17684: let's very explicitly say that the name is
too long for us, and that we'll ignore it.
(cherry picked from commit 3ebc9b9b30b04a3aeec55a11022b337ec5fdb5cf)
(cherry picked from commit 264f179b692843fbb5de2e111b85e6e8bb837e68)
-rw-r--r-- | src/core/mount.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/mount.c b/src/core/mount.c index 8e83de0ba8..91dd60f5c9 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1692,11 +1692,18 @@ static int mount_setup_unit( .burst = 1, }; + if (r == -ENAMETOOLONG) + return log_struct_errno( + ratelimit_below(&rate_limit) ? LOG_WARNING : LOG_DEBUG, r, + "MESSAGE_ID=" SD_MESSAGE_MOUNT_POINT_PATH_NOT_SUITABLE_STR, + "MOUNT_POINT=%s", where, + LOG_MESSAGE("Mount point path '%s' too long to fit into unit name, ignoring mount point.", where)); + return log_struct_errno( ratelimit_below(&rate_limit) ? LOG_WARNING : LOG_DEBUG, r, "MESSAGE_ID=" SD_MESSAGE_MOUNT_POINT_PATH_NOT_SUITABLE_STR, "MOUNT_POINT=%s", where, - LOG_MESSAGE("Failed to generate valid unit name from path '%s', ignoring mount point: %m", where)); + LOG_MESSAGE("Failed to generate valid unit name from mount point path '%s', ignoring mount point: %m", where)); } u = manager_get_unit(m, e); |