On Thu, 2025-11-06 at 20:08 -0500, Benjamin Marzinski wrote: > When libmpathpersist registers a key, It first checks which paths are > active, then registers the key on those paths, and then tells > multipathd > that the key has been registered, and it should start tracking it. If > a path comes up after libmpathpersist checks for active paths, but > before > it tells multipathd that the key has been registered, multipathd will > not > register a key no that path (since it hasn't been told to that the > device > has a registered key yet). This can leave the device with a path that > is > missing a key. > > To solve this, when multipathd is told that a key has been > registered, > it checks if there are the same number of registered keys as active > paths. If there aren't, it registers keys on all the paths (at least > until the number of registered keys and active paths are equal). To > avoid doing a bunch of unnecessary PR work, > pr_register_active_paths() > has a new option to track the number of active paths, and > mpath_pr_event_handle() now takes the number of keys to expect. The > first time it's called, when there is an unknown number of keys, if > the > number of keys it finds matches the number of active_paths, it and > pr_register_active_paths() exit early, since there is no registering > work to do. > > Signed-off-by: Benjamin Marzinski <[email protected]>
Reviewed-by: Martin Wilck <[email protected]>
