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