core: prevent excessive /proc/self/mountinfo parsing

This commit is contained in:
Michal Sekletár 2020-07-09 18:16:44 +02:00 committed by Lennart Poettering
parent 68d8906517
commit d586f642fd
1 changed files with 6 additions and 0 deletions

View File

@ -1855,6 +1855,12 @@ static void mount_enumerate(Manager *m) {
goto fail;
}
r = sd_event_source_set_ratelimit(m->mount_event_source, 1 * USEC_PER_SEC, 5);
if (r < 0) {
log_error_errno(r, "Failed to enable rate limit for mount events: %m");
goto fail;
}
(void) sd_event_source_set_description(m->mount_event_source, "mount-monitor-dispatch");
}