multipathd: fix race condition in uev_remove_path()

When removing a path multipathd would drop the lock just
after it found a path structure. This opened a race window
where the path could be freed before the lock was taken
again.

References: bnc#890994

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipathd: Fixup race condition in uev_update_map

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipathd: fix race condition in uev_add_path()

uev_add_path() will look up the path, but then drop the lock
before starting handling it. So some other thread might remove
the path before retrieving the lock again, and ev_add_path()
might work on an invalid path.

References: bnc#890994

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipath: do not print state 'orphan' for option '-l'

When called with '-l' multipath would mistakenly print a state
of 'orphan' instead off 'running' of 'offline'.
This is a regression introduced by commit 7023d320.

References: bnc#890551

Signed-off-by: Hannes Reinecke <hare@suse.de>
Return error when receiving CLI packet

When receiving a packet from the CLI we should be returning
an error code.

References: bnc#890551

Signed-off-by: Hannes Reinecke <hare@suse.de>
Implement 'uxsock_timeout' keyword

On larger systems the default CLI receive timeout of 1 second
might be too small, and the CLI commands might fail before
they can be processed. For these cases I've implemented a new
keywork 'uxsock_timeout' which can be increased to avoid these
issues.

References: bnc#890551

Signed-off-by: Hannes Reinecke <hare@suse.de>
Do not print empty multipaths section

The CLI command 'show config' or the 'multipath -t' command
should not print an empty 'multipaths' section.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Structure misalignment in config.h

config.h has a conditional define, which caused a structure
misalignment, resulting in a horrible crash in multipath.
Fix this by always compiling in the field, even if unused.

References: bnc#890747

Signed-off-by: Hannes Reinecke <hare@suse.de>
Close memory leak in print_multipath_topology

Detected by valgrind.

Signed-off-by: Hannes Reinecke <hare@suse.de>
- Update changelog.
multipathd: reload map if reinstate failed

The kernel might fail the 'reinstate' device-mapper message
if the path is disabled. In these cases we need to reload the
map to give device-mapper a chance to add the correct devices
to the table.

References: bnc#890854

Signed-off-by: Hannes Reinecke <hare@suse.de>
- Update Changelog