diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-04-28 20:57:45 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-04-30 04:14:10 +0900 |
commit | a7fb1f2eae3314c28d451822302283a7ab1bc1c0 (patch) | |
tree | 161ac9037d5b8823ee5e4c680752c46bef1d4ebe /src/core/device.c | |
parent | 47e72170c1e808708b378ea83bf691d674b344ee (diff) | |
download | systemd-a7fb1f2eae3314c28d451822302283a7ab1bc1c0.tar.gz |
core/device: unit_name_from_path() does not return -ENAMETOOLONG anymore
Follow-up for 1d0727e76fd5e9a07cc9991ec9a10ea1d78a99c7.
Diffstat (limited to 'src/core/device.c')
-rw-r--r-- | src/core/device.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/core/device.c b/src/core/device.c index 81e4cdcd85..95dff82612 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -490,32 +490,12 @@ static int device_setup_unit(Manager *m, sd_device *dev, const char *path, bool } r = unit_name_from_path(path, ".device", &e); - if (r < 0) { - /* Let's complain about overly long device names only at most once every 5s or so. This is - * something we should mention, since relevant devices are not manageable by systemd, but not - * flood the log about. */ - static RateLimit rate_limit = { - .interval = 5 * USEC_PER_SEC, - .burst = 1, - }; - - /* If we cannot convert a device name to a unit name then let's ignore the device. So far, - * devices with such long names weren't really the kind you want to manage with systemd - * anyway, hence this shouldn't be a problem. */ - - if (r == -ENAMETOOLONG) - return log_struct_errno( - ratelimit_below(&rate_limit) ? LOG_WARNING : LOG_DEBUG, r, - "MESSAGE_ID=" SD_MESSAGE_DEVICE_PATH_NOT_SUITABLE_STR, - "DEVICE=%s", path, - LOG_MESSAGE("Device path '%s' too long to fit into unit name, ignoring device.", path)); - + if (r < 0) return log_struct_errno( - ratelimit_below(&rate_limit) ? LOG_WARNING : LOG_DEBUG, r, + LOG_WARNING, r, "MESSAGE_ID=" SD_MESSAGE_DEVICE_PATH_NOT_SUITABLE_STR, "DEVICE=%s", path, LOG_MESSAGE("Failed to generate valid unit name from device path '%s', ignoring device: %m", path)); - } u = manager_get_unit(m, e); if (u) { |