3d3dc8
From cb519c7d769851ee5e24c797fc04eaa13383c674 Mon Sep 17 00:00:00 2001
3d3dc8
From: Michal Sekletar <msekleta@redhat.com>
3d3dc8
Date: Mon, 4 Oct 2021 19:41:34 +0200
3d3dc8
Subject: [PATCH] mount: make mount units start jobs not runnable if
3d3dc8
 /p/s/mountinfo ratelimit is in effect
3d3dc8
3d3dc8
(cherry picked from commit a7c93dfe91e88a5a561341c523a45c7f8d71a588)
3d3dc8
3d3dc8
Related: #2036608
3d3dc8
---
3d3dc8
 src/core/mount.c | 3 +++
3d3dc8
 1 file changed, 3 insertions(+)
3d3dc8
3d3dc8
diff --git a/src/core/mount.c b/src/core/mount.c
3d3dc8
index 032a2ca156..ab09e6fbb0 100644
3d3dc8
--- a/src/core/mount.c
3d3dc8
+++ b/src/core/mount.c
3d3dc8
@@ -1957,6 +1957,9 @@ static int mount_can_start(Unit *u) {
3d3dc8
 
3d3dc8
         assert(m);
3d3dc8
 
3d3dc8
+        if (sd_event_source_is_ratelimited(u->manager->mount_event_source))
3d3dc8
+                return -EAGAIN;
3d3dc8
+
3d3dc8
         r = unit_test_start_limit(u);
3d3dc8
         if (r < 0) {
3d3dc8
                 mount_enter_dead(m, MOUNT_FAILURE_START_LIMIT_HIT);