File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1838,6 +1838,21 @@ static bool mount_is_mounted(Mount *m) {
18381838 return UNIT (m )-> perpetual || FLAGS_SET (m -> proc_flags , MOUNT_PROC_IS_MOUNTED );
18391839}
18401840
1841+ static int mount_on_ratelimit_expire (sd_event_source * s , void * userdata ) {
1842+ Manager * m = userdata ;
1843+ int r ;
1844+
1845+ assert (m );
1846+
1847+ /* By entering ratelimited state we made all mount start jobs not runnable, now rate limit is over so let's
1848+ * make sure we dispatch them in the next iteration. */
1849+ r = sd_event_source_set_enabled (m -> run_queue_event_source , SD_EVENT_ONESHOT );
1850+ if (r < 0 )
1851+ log_debug_errno (r , "Failed to enable run queue event source, ignoring: %m" );
1852+
1853+ return 0 ;
1854+ }
1855+
18411856static void mount_enumerate (Manager * m ) {
18421857 int r ;
18431858
@@ -1891,6 +1906,12 @@ static void mount_enumerate(Manager *m) {
18911906 goto fail ;
18921907 }
18931908
1909+ r = sd_event_source_set_ratelimit_expire_callback (m -> mount_event_source , mount_on_ratelimit_expire );
1910+ if (r < 0 ) {
1911+ log_error_errno (r , "Failed to enable rate limit for mount events: %m" );
1912+ goto fail ;
1913+ }
1914+
18941915 (void ) sd_event_source_set_description (m -> mount_event_source , "mount-monitor-dispatch" );
18951916 }
18961917
You can’t perform that action at this time.
0 commit comments