|
|
2864ad |
From a4cefc9f8bf24b2fdcc62cc0d2685698814374d4 Mon Sep 17 00:00:00 2001
|
|
|
2864ad |
From: =?UTF-8?q?Michal=20Sekleta=CC=81r?= <msekleta@redhat.com>
|
|
|
2864ad |
Date: Thu, 26 Mar 2020 13:35:11 +0100
|
|
|
2864ad |
Subject: [PATCH] device: don't emit PropetiesChanged needlessly
|
|
|
2864ad |
MIME-Version: 1.0
|
|
|
2864ad |
Content-Type: text/plain; charset=UTF-8
|
|
|
2864ad |
Content-Transfer-Encoding: 8bit
|
|
|
2864ad |
|
|
|
2864ad |
Functions called from device_setup_unit() already make sure that unit is
|
|
|
2864ad |
enqueued in case it is a new unit or properties exported on the bus have
|
|
|
2864ad |
changed.
|
|
|
2864ad |
|
|
|
2864ad |
This should prevent unnecessary DBus wakeups and associated DBus traffic
|
|
|
2864ad |
when device_setup_unit() was called while reparsing /proc/self/mountinfo
|
|
|
2864ad |
due to the mountinfo notifications. Note that we parse
|
|
|
2864ad |
/proc/self/mountinfo quite often on the busy systems (e.g. k8s container
|
|
|
2864ad |
hosts) but majority of the time mounts didn't change, only some mount
|
|
|
2864ad |
got added. Thus we don't need to generate PropertiesChanged for devices
|
|
|
2864ad |
associated with the mounts that didn't change.
|
|
|
2864ad |
|
|
|
2864ad |
Thanks to Renaud Métrich <rmetrich@redhat.com> for debugging the
|
|
|
2864ad |
problem and providing draft version of the patch.
|
|
|
2864ad |
|
|
|
2864ad |
(cherry picked from commit 2e129d5d6bd6bd8be4b5359e81a880cbf72a44b8)
|
|
|
2864ad |
|
|
|
2864ad |
Resolves: #1793533
|
|
|
2864ad |
---
|
|
|
2864ad |
src/core/device.c | 3 ---
|
|
|
2864ad |
1 file changed, 3 deletions(-)
|
|
|
2864ad |
|
|
|
2864ad |
diff --git a/src/core/device.c b/src/core/device.c
|
|
|
2864ad |
index 21fe3802bd..021c28dfbd 100644
|
|
|
2864ad |
--- a/src/core/device.c
|
|
|
2864ad |
+++ b/src/core/device.c
|
|
|
2864ad |
@@ -549,9 +549,6 @@ static int device_setup_unit(Manager *m, struct udev_device *dev, const char *pa
|
|
|
2864ad |
if (dev && device_is_bound_by_mounts(DEVICE(u), dev))
|
|
|
2864ad |
device_upgrade_mount_deps(u);
|
|
|
2864ad |
|
|
|
2864ad |
- /* Note that this won't dispatch the load queue, the caller has to do that if needed and appropriate */
|
|
|
2864ad |
- unit_add_to_dbus_queue(u);
|
|
|
2864ad |
-
|
|
|
2864ad |
return 0;
|
|
|
2864ad |
|
|
|
2864ad |
fail:
|