oomd: fix race with path unavailability when killing cgroups
authorAnita Zhang <the.anitazha@gmail.com>
Wed, 19 Jan 2022 18:40:46 +0000 (10:40 -0800)
committerAnita Zhang <the.anitazha@gmail.com>
Thu, 20 Jan 2022 22:15:11 +0000 (14:15 -0800)
commit2ee209466bb51f39ae9df7fec4d5594ce8cfa3f0
tree592c61558e664281ac1238214a539883660d4005
parent1bc8417cfeeebb48b16039f26e0c75937784e75e
oomd: fix race with path unavailability when killing cgroups

There can be a situation where systemd-oomd would kill all of the processes
in a cgroup, pid1 would clean up that cgroup, and systemd-oomd would get
ENODEV trying to iterate the cgroup a final time to ensure it was empty.
systemd-oomd sees this as an error and immediately picks a new candidate even
though pressure may have recovered. To counter this, check and handle
path unavailability errnos specially.

Fixes: #22030
src/oom/oomd-util.c