diff options
Diffstat (limited to 'src/core/mount.c')
-rw-r--r-- | src/core/mount.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/core/mount.c b/src/core/mount.c index 0a403b6759..19dd09c58f 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1997,6 +1997,7 @@ static void mount_enumerate(Manager *m) { mnt_init_debug(0); if (!m->mount_monitor) { + usec_t mount_rate_limit_interval = 1 * USEC_PER_SEC; unsigned mount_rate_limit_burst = 5; int fd; @@ -2038,14 +2039,21 @@ static void mount_enumerate(Manager *m) { } /* Let users override the default (5 in 1s), as it stalls the boot sequence on busy systems. */ - const char *e = secure_getenv("SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_BURST"); + const char *e = secure_getenv("SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_INTERVAL_SEC"); + if (e) { + r = parse_sec(e, &mount_rate_limit_interval); + if (r < 0) + log_debug_errno(r, "Invalid value in $SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_INTERVAL_SEC, ignoring: %s", e); + } + + e = secure_getenv("SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_BURST"); if (e) { r = safe_atou(e, &mount_rate_limit_burst); if (r < 0) - log_debug("Invalid value in $SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_BURST, ignoring: %s", e); + log_debug_errno(r, "Invalid value in $SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_BURST, ignoring: %s", e); } - r = sd_event_source_set_ratelimit(m->mount_event_source, 1 * USEC_PER_SEC, mount_rate_limit_burst); + r = sd_event_source_set_ratelimit(m->mount_event_source, mount_rate_limit_interval, mount_rate_limit_burst); if (r < 0) { log_error_errno(r, "Failed to enable rate limit for mount events: %m"); goto fail; |