From: Yu Watanabe Date: Thu, 18 Feb 2021 22:02:44 +0000 (+0900) Subject: sd-device: do not cache action string for uevent file written by sd_device_set_sysatt... X-Git-Tag: v248-rc1~19^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=297d1370f8e41547c909729d3bde6d14667cc010;p=thirdparty%2Fsystemd.git sd-device: do not cache action string for uevent file written by sd_device_set_sysattr_value() As sd_device_get_sysattr_value() may be already used to read uevent file. The read value of uevent file may be usually quite different from the action string. --- diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index 9b6255271f1..28aca4063a4 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -1999,6 +1999,10 @@ _public_ int sd_device_set_sysattr_value(sd_device *device, const char *sysattr, return r; } + /* Do not cache action string written into uevent file. */ + if (streq(sysattr, "uevent")) + return 0; + r = device_cache_sysattr_value(device, sysattr, value); if (r < 0) log_device_debug_errno(device, r,