integ/base/systemd/centos/patches/925-sd-event-use-usec_add.patch
Li Zhou bed1e46362 systemd: fix rate-limiting of mount events
Backport the patches for this issue:
https://bugzilla.redhat.com/show_bug.cgi?id=1968528
It reports:
The fix for Bug 1819868 has introduced a new issue related to its
implementation of rate limiting.
Rate limiting the mount_event_source can cause unmount events to be
missed, which leads to mount unit cgroups being leaked (not cleaned up
when the mount is gone).

The fix for 1968528 can fix the issue we met:
During the reboot process of subclouds (either lock-unlock or sudo
reboot), unmounting failure messages repeat for a few hundred of times.

The patches are listed at:
https://github.com/redhat-plumbers/systemd-rhel8/pull/198/commits
And they are picked from https://github.com/systemd-rhel/rhel-8/ (branch
rhel-8.4.0).

Verification:
  In my test on an AIO-SX lab, the bug appears as:
  run "sudo reboot" on controller, endless unmounting failure logs
  printed.
  Verified that the problem was there during the shutdown
  phase of a reboot. Reinstalled with a fixed image, and verified that
  the issue was now gone by doing 5 reboots. Ran sanity on the lab,
  and verified no new issues seen.

Closes-Bug: #1948899
Signed-off-by: Li Zhou <li.zhou@windriver.com>
Change-Id: If95932ceead1bea973f2219d3a8d6b04cf0fd5f8
2021-10-28 23:29:07 -04:00

36 lines
1.2 KiB
Diff

From e2088e9fd7dd09c542d8c456b62dbd2d21ee9e51 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Tue, 15 Jun 2021 01:01:48 +0900
Subject: [PATCH 4/6] sd-event: use usec_add()
(cherry picked from commit a595fb5ca9c69c589e758e9ebe3b70ac90450ba3)
Related: #1984406
[commit b8732d647162b50ce9b34de2ad7ae11a53f6e7ba from
https://github.com/systemd-rhel/rhel-8/ (branch rhel-8.4.0)]
Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
src/libsystemd/sd-event/sd-event.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index 84a874d..1cf1c41 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -2663,8 +2663,8 @@ static int arm_watchdog(sd_event *e) {
assert(e->watchdog_fd >= 0);
t = sleep_between(e,
- e->watchdog_last + (e->watchdog_period / 2),
- e->watchdog_last + (e->watchdog_period * 3 / 4));
+ usec_add(e->watchdog_last, (e->watchdog_period / 2)),
+ usec_add(e->watchdog_last, (e->watchdog_period * 3 / 4)));
timespec_store(&its.it_value, t);
--
2.17.1