]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nodedev: ignore EINVAL from libudev in udevEventHandleThread
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>
Thu, 10 Nov 2022 09:36:28 +0000 (10:36 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 10 Nov 2022 10:50:22 +0000 (11:50 +0100)
commit33a38492b75acb7dbec9b64c41a5dba4acde4240
tree353dd5261ed63f5ff404f670cfbf4d11e16a362e
parent2e16c9f20280fc051adea7544600fdc351415739
nodedev: ignore EINVAL from libudev in udevEventHandleThread

Certain udev entries might be of a size that makes libudev emit EINVAL
which right now leads to udevEventHandleThread exiting. Due to no more
handling events other elements of libvirt will start pushing for events
to be consumed which never happens causing a busy loop burning a cpu
without any gain.

After evaluation of the example case discussed in in #245 and a test
run ignoring EINVAL it was considered safe to add EINVAL to the ignored
errnos to not exit udevEventHandleThread giving it more resilience.

The root cause is in systemd and by now was discussed and fixed via
https://github.com/systemd/systemd/issues/24987, but hardening libvirt
to be able to better deal with EINVAL returned still is the right thing
to avoid the reported busy loops on systemd with older systemd versions.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/245
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/node_device/node_device_udev.c