From ca0cef28691be7ea22274c2fa7d95a2725da1ba5 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 24 Nov 2024 13:19:27 +0900 Subject: [PATCH 1/2] core/device: ignore ID_PROCESSING udev property on enumerate This partially reverts the commit 405be62f05d76f1845f347737b5972158c79dd3e "tree-wide: refuse enumerated device with ID_PROCESSING=1". Otherwise, when systemd-udev-trigger.service is started just before daemon-reexec, which can be easily happen on update, then udev database files for many devices may have ID_PROCESSING=1 property, thus devices may not enumerated on daemon-reexec. That causes many units especially mount units deactivated after daemon-reexec. Fixes #35329. --- src/core/device.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/core/device.c b/src/core/device.c index 03a730f6240c1..a8921e91c344e 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -1048,9 +1048,6 @@ static void device_enumerate(Manager *m) { _cleanup_set_free_ Set *ready_units = NULL, *not_ready_units = NULL; Device *d; - if (device_is_processed(dev) <= 0) - continue; - if (device_setup_units(m, dev, &ready_units, ¬_ready_units) < 0) continue; From 388151b72103c10d63bac1e845d6a151619990ae Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 24 Nov 2024 13:57:37 +0900 Subject: [PATCH 2/2] test: add reproducer for issue #35329 Without the previous commit, the test case will fail. --- .../TEST-17-UDEV.device_is_processing.sh | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 test/units/TEST-17-UDEV.device_is_processing.sh diff --git a/test/units/TEST-17-UDEV.device_is_processing.sh b/test/units/TEST-17-UDEV.device_is_processing.sh new file mode 100755 index 0000000000000..9b39b43238e44 --- /dev/null +++ b/test/units/TEST-17-UDEV.device_is_processing.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -ex +set -o pipefail + +# This is a reproducer of issue #35329, +# which is a regression caused by 405be62f05d76f1845f347737b5972158c79dd3e. + +IFNAME=udevtestnetif + +udevadm settle + +mkdir -p /run/udev/udev.conf.d/ +cat >/run/udev/udev.conf.d/timeout.conf </run/udev/rules.d/99-testsuite.rules <