udev: make algorithm that selects highest priority devlink less susceptible to race...
authorMichal Sekletar <msekleta@redhat.com>
Wed, 6 Jan 2021 10:43:50 +0000 (11:43 +0100)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Mon, 25 Jan 2021 14:05:18 +0000 (15:05 +0100)
commit1d5f966c1758eb620755fcae54abd07a1ac36d3d
treecdba86f24cd19b2a7ba362792538f5e8e049089c
parent29c5b8dd6228c4401f034ca0aa85f99ac42cf8dd
udev: make algorithm that selects highest priority devlink less susceptible to race conditions

Previously it was very likely, when multiple contenders for the symlink
appear in parallel, that algorithm would select wrong symlink (i.e. one
with lower-priority).

Now the algorithm is much more defensive and when we detect change in
set of contenders for the symlink we reevaluate the selection. Same
happens when new symlink replaces already existing symlink that points
to different device node.

Resolves: #1642728
src/udev/udev-event.c
src/udev/udev-node.c