print the real reason for link update

(cherry picked from commit 18658f18e3f08121f506ec0ba4127ed03a9c25e7)
This commit is contained in:
xujing 2022-04-12 14:48:19 +08:00 committed by openeuler-sync-bot
parent d3a4d14c77
commit d5bc38ae27
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From 7ed8309747a2947ff1ea0f4149e0501f1eb81271 Mon Sep 17 00:00:00 2001
From: gaoyi <gaoyi15@huawei.com>
Date: Tue, 20 Jul 2021 15:09:28 +0800
Subject: [PATCH] print the real reason for link update
reduce retries to improve performance and print the real
reaseon when the max retries reached
---
src/udev/udev-node.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index 9e52906..8b7996d 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -29,7 +29,7 @@
#include "user-util.h"
#define CREATE_LINK_MAX_RETRIES 128
-#define LINK_UPDATE_MAX_RETRIES 128
+#define LINK_UPDATE_MAX_RETRIES 4
#define TOUCH_FILE_MAX_RETRIES 128
#define UDEV_NODE_HASH_KEY SD_ID128_MAKE(b9,6a,f1,ce,40,31,44,1a,9e,19,ec,8b,ae,f3,e3,2f)
@@ -353,7 +353,10 @@ static int link_update(sd_device *dev, const char *slink_in, bool add) {
}
}
- return i < LINK_UPDATE_MAX_RETRIES ? 0 : -ELOOP;
+ if (i >= LINK_UPDATE_MAX_RETRIES)
+ log_device_debug(dev, "Exceeded max retries for link update");
+
+ return 0;
}
int udev_node_update_old_links(sd_device *dev, sd_device *dev_old) {
--
2.27.0

View File

@ -20,7 +20,7 @@
Name: systemd Name: systemd
Url: https://www.freedesktop.org/wiki/Software/systemd Url: https://www.freedesktop.org/wiki/Software/systemd
Version: 249 Version: 249
Release: 23 Release: 24
License: MIT and LGPLv2+ and GPLv2+ License: MIT and LGPLv2+ and GPLv2+
Summary: System and Service Manager Summary: System and Service Manager
@ -72,6 +72,7 @@ Patch0023: 0023-delay-to-restart-when-a-service-can-not-be-auto-restarted.p
Patch0024: 0024-disable-initialize_clock.patch Patch0024: 0024-disable-initialize_clock.patch
Patch0025: 0025-systemd-solve-that-rsyslog-reads-journal-s-object-of.patch Patch0025: 0025-systemd-solve-that-rsyslog-reads-journal-s-object-of.patch
Patch0026: 0026-check-whether-command_prev-is-null-before-assigning-.patch Patch0026: 0026-check-whether-command_prev-is-null-before-assigning-.patch
Patch0027: 0027-print-the-real-reason-for-link-update.patch
#backport #backport
Patch6000: backport-core-fix-free-undefined-pointer-when-strdup-failed-i.patch Patch6000: backport-core-fix-free-undefined-pointer-when-strdup-failed-i.patch
@ -1503,6 +1504,9 @@ fi
%{_libdir}/security/pam_systemd.so %{_libdir}/security/pam_systemd.so
%changelog %changelog
* Tue Apr 12 2022 xujing <xujing99@huawei.com> - 249-24
- print the real reason for link update
* Tue Apr 12 2022 xujing <xujing99@huawei.com> - 249-23 * Tue Apr 12 2022 xujing <xujing99@huawei.com> - 249-23
- check whether command_prev is null before assigning value - check whether command_prev is null before assigning value