multipath-tools/.git
8 months agoBump version to 0.7.9 0.7.9
Christophe Varoqui [Wed, 14 Nov 2018 07:37:05 +0000 (08:37 +0100)]
Bump version to 0.7.9

8 months agomultipathd: reset delay_wait_checks counter on failure
Martin Wilck [Tue, 13 Nov 2018 21:30:52 +0000 (22:30 +0100)]
multipathd: reset delay_wait_checks counter on failure

If path reinstantiation is delayed by delay_wait_checks, wait_checks
is counting down, the path fails during the delay phase, and then
comes up again, the wait_check counter starts counting down at the
same value where it previously stopped, which may be very low (even 1).

To avoid that, reset the counter to pp->delay_wait_checks if a failure
is encountered during the delay phase.

Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agomultipathd: fix irritating "minor number mismatch" message
Martin Wilck [Tue, 13 Nov 2018 21:30:51 +0000 (22:30 +0100)]
multipathd: fix irritating "minor number mismatch" message

This is really an alias mismatch, not a minor number mismatch.

Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agomultipathd: only grab conf once for filter_path()
Martin Wilck [Fri, 2 Nov 2018 12:24:02 +0000 (13:24 +0100)]
multipathd: only grab conf once for filter_path()

This saves a possibly large number of cleanup push/pop calls and
slightly improves readability.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agomultipathd: make DAEMON_SHUTDOWN a terminal state
Martin Wilck [Fri, 2 Nov 2018 12:24:01 +0000 (13:24 +0100)]
multipathd: make DAEMON_SHUTDOWN a terminal state

It can happen that, before the main thread reacts on DAEMON_SHUTDOWN
and starts cancelling threads, another thread resets the state to
something else. Fix that.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agomultipathd: set DAEMON_CONFIGURE from uxlsnr thread
Martin Wilck [Fri, 2 Nov 2018 12:24:00 +0000 (13:24 +0100)]
multipathd: set DAEMON_CONFIGURE from uxlsnr thread

Commit ee01e841 had the intention to make multipathd quit if
the client socket couldn't be set up, because the unix socket
listener is vital for signal handling in multipathd.
But during startup, this condition might be lost if the main
thread doesn't wait for the unix listener to initialize.

Fixes: ee01e841 "multipathd: handle errors in uxlsnr as fatal"

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agomultipathd: open client socket early
Martin Wilck [Fri, 2 Nov 2018 12:23:59 +0000 (13:23 +0100)]
multipathd: open client socket early

Open the unix socket in multipathd code and pass the fd to
uxsock_listen(). This will enable us to make the main thread
wait for successful socket initialization in a follow-up patch.

Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agomultipathd: print error message if checkint is not initialized
Martin Wilck [Fri, 2 Nov 2018 12:23:58 +0000 (13:23 +0100)]
multipathd: print error message if checkint is not initialized

This is just a safety measure in case I overlooked something wrt
the checkint initialization. It could be reverted once we know the
error message isn't triggered.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agomultipathd: remove init_path_check_interval()
Martin Wilck [Fri, 2 Nov 2018 12:23:57 +0000 (13:23 +0100)]
multipathd: remove init_path_check_interval()

After "libmultipath: set pp->checkint in store_pathinfo()",
pp-checkint should always be properly initialized, so this code
is not needed any more.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath: set pp->checkint in store_pathinfo()
Martin Wilck [Fri, 2 Nov 2018 12:23:56 +0000 (13:23 +0100)]
libmultipath: set pp->checkint in store_pathinfo()

store_pathinfo is called with valid conf pointer anyway, so
checkint is available. pp->checkint is now valid for every
path after path_discovery().

This fixes a bad conf access in cli_add_path().

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath/checkers: cleanup class/instance model
Martin Wilck [Fri, 2 Nov 2018 12:21:25 +0000 (13:21 +0100)]
libmultipath/checkers: cleanup class/instance model

The checkers code implicitly uses a sort-of OOP class/instance model,
but very clumsily. Separate the checker "class" and "instance" cleanly,
and do a few further cleanups (constifications etc) on the way.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath: sync_map_state: log failing paths
Martin Wilck [Fri, 2 Nov 2018 12:21:24 +0000 (13:21 +0100)]
libmultipath: sync_map_state: log failing paths

Emit a log message when force-failing exisiting paths.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath: coalesce_paths: improve logging of orphaned paths
Martin Wilck [Fri, 2 Nov 2018 12:21:23 +0000 (13:21 +0100)]
libmultipath: coalesce_paths: improve logging of orphaned paths

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agomultipathd: check_path: improve logging for "unusable path" case
Martin Wilck [Fri, 2 Nov 2018 12:21:22 +0000 (13:21 +0100)]
multipathd: check_path: improve logging for "unusable path" case

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath: pathinfo: don't blank wwid if checker fails
Martin Wilck [Fri, 2 Nov 2018 12:21:21 +0000 (13:21 +0100)]
libmultipath: pathinfo: don't blank wwid if checker fails

Blanking a WWID is a dangerous operation. E.g. configure() would
consider the path in question as invalid and orphan it if the
WWID is blank. Don't do this checker failures which may be transient
or indicate a badly configured or otherwise malfunctioning checker.
Moreover, we try to determine WWID even if path_offline returns
PATH_DOWN in the first place, so why should we not if the checker
has a problem?

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath: tur checker: leave unsupported paths alone
Martin Wilck [Fri, 2 Nov 2018 12:21:20 +0000 (13:21 +0100)]
libmultipath: tur checker: leave unsupported paths alone

A checker shouldn't set the path state to PATH_DOWN if it fails
to obtain information about the path in the first place. Add logic
to the checker to distinguish a failed path from an unsupported path.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath: rdac checker: leave unsupported paths alone
Martin Wilck [Fri, 2 Nov 2018 12:21:19 +0000 (13:21 +0100)]
libmultipath: rdac checker: leave unsupported paths alone

A checker shouldn't set the path state to PATH_DOWN if it fails
to obtain information about the path in the first place. Add logic
to the checker to distinguish a failed path from an unsupported path.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath: hp_sw checker: leave unsupported paths alone
Martin Wilck [Fri, 2 Nov 2018 12:21:18 +0000 (13:21 +0100)]
libmultipath: hp_sw checker: leave unsupported paths alone

A checker shouldn't set the path state to PATH_DOWN if it fails
to obtain information about the path in the first place. Add logic
to the checker to distinguish a failed path from an unsupported path.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath: clariion checker: leave unsupported paths alone
Martin Wilck [Fri, 2 Nov 2018 12:21:17 +0000 (13:21 +0100)]
libmultipath: clariion checker: leave unsupported paths alone

A checker shouldn't set the path state to PATH_DOWN if it fails
to obtain information about the path in the first place. Add logic
to the checker to distinguish a failed path from an unsupported path.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath/checkers: support unsupported paths
Martin Wilck [Fri, 2 Nov 2018 12:21:16 +0000 (13:21 +0100)]
libmultipath/checkers: support unsupported paths

We should be able to distinguish the case where a checker
determines a path to be positively down from the case where
the checker fails to obtain necessary information, e.g.
because of a configuration problem (wrong checker).
Use PATH_WILD for the latter case, as it's hardly used now.

Provide a generic message for the situation that a path
checker can't handle a certain path.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agomultipathd: improve checker message logging
Martin Wilck [Fri, 2 Nov 2018 12:21:15 +0000 (13:21 +0100)]
multipathd: improve checker message logging

Don't rely on any variables being defined in LOG_MSG.
If message log level is low, don't bother to fetch the message.

Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath/checkers: tur: use message id
Martin Wilck [Fri, 2 Nov 2018 12:21:14 +0000 (13:21 +0100)]
libmultipath/checkers: tur: use message id

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath/checkers: readsector0: use message id
Martin Wilck [Fri, 2 Nov 2018 12:21:13 +0000 (13:21 +0100)]
libmultipath/checkers: readsector0: use message id

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath/checkers: rdac: use message id
Martin Wilck [Fri, 2 Nov 2018 12:21:12 +0000 (13:21 +0100)]
libmultipath/checkers: rdac: use message id

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath/checkers: hp_sw: use message id
Martin Wilck [Fri, 2 Nov 2018 12:21:11 +0000 (13:21 +0100)]
libmultipath/checkers: hp_sw: use message id

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath/checkers: emc_clariion: use message id
Martin Wilck [Fri, 2 Nov 2018 12:21:10 +0000 (13:21 +0100)]
libmultipath/checkers: emc_clariion: use message id

emc_clariion is the only path checker that was using a non-constant
message ("read error" case). This isn't possible with the msgid
approach any more. Use condlog() for the dynamic log message and
simply report "read error" as checker message.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath/checkers: directio: use message id
Martin Wilck [Fri, 2 Nov 2018 12:21:09 +0000 (13:21 +0100)]
libmultipath/checkers: directio: use message id

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath/checkers: cciss_tur: use message id
Martin Wilck [Fri, 2 Nov 2018 12:21:08 +0000 (13:21 +0100)]
libmultipath/checkers: cciss_tur: use message id

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath/checkers: replace message by msgid
Martin Wilck [Fri, 2 Nov 2018 12:21:07 +0000 (13:21 +0100)]
libmultipath/checkers: replace message by msgid

Replace the character array "message" in struct checker with
a "message ID" field.

The generic checker code defines a couple of standard message IDs
and corresponding messages. Checker-specific message IDs start
at CHECKER_FIRST_MSG. Checkers that implement specific message
IDs must provide a table for converting the IDs into actual log
messages.

This simplifies the checker data structure and the handling of
checker messages in the critical checker code path. It comes at
the cost that only constant message strings are supported. It
turns out that only a single checker log message (in the emc_clariion
checker) was dynamically generated, and the missing information can
be provided with a standard condlog message.

Follow-up patches implement this for the existing checkers.

Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath: fix memory leaks from scandir() use
Martin Wilck [Fri, 2 Nov 2018 12:21:06 +0000 (13:21 +0100)]
libmultipath: fix memory leaks from scandir() use

scandir() users must not only free the resulting dirent* array,
but also every member. Add a cleanup function, and fix the
existing users of scandir() in libmultipath.

Add a small helper macro for casting function pointers to the
type pthread_cleanup_push() expects.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath: fix use of uninitialized memory in write()
Martin Wilck [Fri, 2 Nov 2018 12:21:05 +0000 (13:21 +0100)]
libmultipath: fix use of uninitialized memory in write()

valgrind complained about this.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agomultipath.8: fix description of "device" argument
Martin Wilck [Tue, 23 Oct 2018 13:43:48 +0000 (15:43 +0200)]
multipath.8: fix description of "device" argument

Describe the fact that we can refer to path devices by WWID, and
to multipath maps by devnode.

Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agomultipathd: improve "add missing path" handling
Martin Wilck [Tue, 23 Oct 2018 13:43:47 +0000 (15:43 +0200)]
multipathd: improve "add missing path" handling

Only add devices that have been properly initialized by pathinfo().
For others, increase the path check interval to avoid useless checks
of devices which are probably not meant to be multipathed anyway.

The check for pp->initialized != INIT_MISSING_UDEV is redundant,
as check_path() returns early in all other cases. Replace it by a
check for INIT_FAILED, in case we ever add more init states.

Suggested-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agomultipathd: handle repeated udev retrigger failure
Martin Wilck [Tue, 23 Oct 2018 13:43:46 +0000 (15:43 +0200)]
multipathd: handle repeated udev retrigger failure

If a path was still not properly initialized after exhausting the
retrigger tries, it used to remain in INIT_MISSING_UDEV state forever.
get_uid() might fall back to non-udev-based methods to determine
the WWID, but it would never be called for a path in this state any more.

This patch changes this behavior by resetting the path back to FAILED
state if udev can't provide the WWID even after retriggering. Now, if
the path ever happens to be in PATH_UP or PATH_GHOST state again,
pathinfo(DI_ALL) will be called from check_path(), and there's at least
some chance to obtain a WWID for it.

Signed-off-by: Martin Wilck <mwilck@suse.com>
8 months agolibmultipath: handle TUR threads that can't be cancelled
Martin Wilck [Tue, 23 Oct 2018 13:43:45 +0000 (15:43 +0200)]
libmultipath: handle TUR threads that can't be cancelled

When the tur checker code determines that a hanging TUR thread
couldn't be cancelled, rather than simply returning, reallocate
the checker context and start a new thread. This will leak some
memory if the hanging thread never wakes up again, but well, in
that highly unlikely case we're leaking threads anyway.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agolibmultipath: test code for "zombie" TUR threads
Martin Wilck [Wed, 10 Oct 2018 20:05:04 +0000 (22:05 +0200)]
libmultipath: test code for "zombie" TUR threads

This patch adds test code that simulates hanging, non-cancellable
TUR threads, for testing multipathd's behavior in that situation.
Compile libmultipath with CFLAGS=-DTUR_TEST_MAJOR=8 to activate
the test code. Without that flag, the patch has no effect.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agomultipath.8: man page update
Martin Wilck [Wed, 10 Oct 2018 20:05:03 +0000 (22:05 +0200)]
multipath.8: man page update

Clean up the synopsis, listing only combinations of command line switches
that work and make sense. Split the switches between "operation modes"
and options. Fix the documentation of the -v switch, which was wrong.
Move the description of the "device" argument to the top. Link to
multipath.conf(5) for the description of the path grouping policy rather
than repeating the content here. Various minor improvements and clarifications.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agomultipath.rules: add comment about DM_MULTIPATH_DEVICE_PATH=2
Martin Wilck [Wed, 10 Oct 2018 20:05:02 +0000 (22:05 +0200)]
multipath.rules: add comment about DM_MULTIPATH_DEVICE_PATH=2

See dm-devel discussion "Changes in DM_MULTIPATH_DEVICE_PATH in
multipath-tools 0.7.7" (Sep. 2018) for rationale.

Cc: Adam Williamson <awilliam@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agolibmultipath: cciss_ioctl_pathinfo doesn't fail
Martin Wilck [Wed, 10 Oct 2018 20:05:01 +0000 (22:05 +0200)]
libmultipath: cciss_ioctl_pathinfo doesn't fail

Make it a void function and move the DI_SERIAL test to pathinfo().

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agolibmultipath: scsi_ioctl_pathinfo doesn't fail
Martin Wilck [Wed, 10 Oct 2018 20:05:00 +0000 (22:05 +0200)]
libmultipath: scsi_ioctl_pathinfo doesn't fail

This function never returns error, so make a void.
Move the mask test to pathinfo() where it belongs.
The error message about the serial number isn't important
any more, reduce its level to v3.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agotest-kpartx: add test for invocation on image file
Martin Wilck [Wed, 10 Oct 2018 20:04:59 +0000 (22:04 +0200)]
test-kpartx: add test for invocation on image file

Add a test for kpartx invocation on an image file that is not
yet part of a loop device, passing a relative path to kpartx:

        # kpartx -av disk.img
        ...
        # kpartx -d disk.img

The recent patches 95c4189b "kpartx: Use absolute paths to create mappings"
and c1adcc5b "kpartx: Use absolute paths to create mappings" both
independently fixed this behavior, which had been broken previously by
9bdfa3eb "kpartx: use absolute path for regular files".

Cc: Stef Walter <stefw@redhat.com>
Cc: Yuval Turgeman <yturgema@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agomultipath-tools: delete trailing whitespaces
Xose Vazquez Perez [Wed, 10 Oct 2018 19:51:16 +0000 (21:51 +0200)]
multipath-tools: delete trailing whitespaces

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM-DEV ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
9 months agolibmultipath: timeout on unresponsive tur thread
Benjamin Marzinski [Wed, 10 Oct 2018 18:01:13 +0000 (13:01 -0500)]
libmultipath: timeout on unresponsive tur thread

If the tur checker thread has been cancelled but isn't responding,
timeout instead of doing a sync check.  This will keep one bad
device from impacting all of multipathd.

Fixes: 455242d ("libmultipath: fix tur checker timeout")
Cc: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agompathpersist: fix registration rollback issue
Benjamin Marzinski [Wed, 10 Oct 2018 18:01:12 +0000 (13:01 -0500)]
mpathpersist: fix registration rollback issue

When mpathpersist tries to rollback the registration, it copies
the SARK to the RK, and clears the SARK. However, it repeated this step
for each thread. This means that the first rollback thread correctly
had the RK set to the SARK used during registration. However, if more
than one registration needed to be rolled back, later threads would have
both the RK and SARK cleared. This commit fixes that by only copying and
clearing the SARK once.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agomultipathd: set return code for multipathd commands
Benjamin Marzinski [Wed, 10 Oct 2018 18:01:11 +0000 (13:01 -0500)]
multipathd: set return code for multipathd commands

Failed multipathd commands should set the return code to 1.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: remove max_fds code duplication
Benjamin Marzinski [Wed, 10 Oct 2018 18:01:10 +0000 (13:01 -0500)]
libmultipath: remove max_fds code duplication

Instead of multipath, multipathd, and mpathpersist all having code to
set the max number of open file descriptors, just use a util function to
do it.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agomultipathd: check for NULL udevice in cli_add_path
Benjamin Marzinski [Wed, 10 Oct 2018 18:01:09 +0000 (13:01 -0500)]
multipathd: check for NULL udevice in cli_add_path

If cli_add_path can't get a udevice for the path, it should fail
immediately, instead of continuing with a NULL udevice, since it will
fail in store_pathinfo() anyway.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agomultipath: tweak logging style
Benjamin Marzinski [Wed, 10 Oct 2018 18:01:08 +0000 (13:01 -0500)]
multipath: tweak logging style

When multipathd commands are run, errors should be printed to stderr,
instead of syslog. Also, when the multipath is run and calls
device-mapper, device-mapper should log to stderr instead of stdout,
just like multipath does now.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agokpartx: fix new memory leak in dm_find_part
Benjamin Marzinski [Thu, 11 Oct 2018 20:43:48 +0000 (15:43 -0500)]
kpartx: fix new memory leak in dm_find_part

While commit 960bb238 fixed one memory leak, it created another.

Fixes: 960bb238 ("kpartx: Fix memory leak of uuid found by coverity")
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: free allocated value in set_int
Benjamin Marzinski [Thu, 11 Oct 2018 20:43:47 +0000 (15:43 -0500)]
libmultipath: free allocated value in set_int

set_int() needs to free the buffer it got back from set_value()

Fixes: 8f9ac30d ("libmultipath: fix set_int error path")
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agoBump version to 0.7.8 0.7.8
Christophe Varoqui [Wed, 10 Oct 2018 06:12:21 +0000 (08:12 +0200)]
Bump version to 0.7.8

9 months agolibmultipath: Fixup updating paths
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:16 +0000 (18:03 -0500)]
libmultipath: Fixup updating paths

Commit 582c56cc broke some code paths in uev_update_path. First, it
changed the handling of paths that were not fully initialized.
uev_update_path was simply setting the wwids for all of these paths.
Instead, it should ignore the ones that had not requested a new uevent.
These paths are likely down, and are already getting handled by
check_path, after it verifies that they have become active. Also,
setting the wwid doesn't update all of the other information that
may have been missed when the path was initially added.

Also, it wasn't possible for pp->wwid_changed to transition back to
zero, unless the path's wwid was empty, in which case there was no
reason to worry about the wwid change in the first place, since the path
hadn't been fully initialized yet. So, even if a path's wwid changed and
then changed back to the original value, the path still could not be
used.

This patch fixes these issues, and also moves the check for paths that
have requested a new uevent up in the functions. These paths will get
fully reinitialized anyway, so there is no reason to do all the other
work first.

Fixes: 582c56cc ("libmultipath: uev_update_path: always warn if WWID
changed")

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: Don't blank intialized paths
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:15 +0000 (18:03 -0500)]
libmultipath: Don't blank intialized paths

When pathinfo fails for some likely transient reason, it clears the path
wwid, but otherwise returns successfully, to keep the path around but
not usable until it gets fully initialized. However, if the path has
already been initialized, and pathinfo hits a transient error, it
shouldn't clear the wwid.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agomultipathd: fix memory leak on error in configure
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:14 +0000 (18:03 -0500)]
multipathd: fix memory leak on error in configure

If configure fails after allocing mpvec, it must free it. Found by
coverity.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agomultipathd: remove useless check and fix format
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:13 +0000 (18:03 -0500)]
multipathd: remove useless check and fix format

The only thing this patch changes is to remove the check for pp->mpp
before the check for pp->mpp->prflags, since check_path() already
verified that pp->mpp != NULL. This fixes a number of coverity warnings.
Also, I normalized the spacing and indenting of the nearby code.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agomultipathd: minor fixes
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:12 +0000 (18:03 -0500)]
multipathd: minor fixes

In update_multipath(), conf is set again in a couple of lines, and
nothing uses it before then, so there's no point in setting it twice.
Also, in ev_remove_path(), strncpy() could end up unterminated, so
use strlcpy() instead.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agomultipathd: function return value tweaks
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:11 +0000 (18:03 -0500)]
multipathd: function return value tweaks

In cli_add_map() the return value of get_refwwid is never used, and
refwwid is checked to see if the function returned successfully, so the
return value doesn't need to be saved.

In resize_map, if setup_map fails, multipathd shouldn't attempt to
create the device with resulting params string. It should just fail
instead. Found by coverity.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agomultipath: fix max array size in print_cmd_valid
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:10 +0000 (18:03 -0500)]
multipath: fix max array size in print_cmd_valid

The code is attempting to verify that 0 <= k < 3
However, sizeof(val) is 12, assuming 4 byte integers. The check needs to
take integer size into account. Found by coverity.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmutipath: don't use malformed uevents
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:09 +0000 (18:03 -0500)]
libmutipath: don't use malformed uevents

A uevent that doesn't include the ACTION and DEVPATH fields is
malformed. It should be ignored, instead of used with those fields being
NULL.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: fix null dereference int alloc_path_group
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:08 +0000 (18:03 -0500)]
libmultipath: fix null dereference int alloc_path_group

If all_pathgroup failed to allocate a vector for pgp->paths, instead of
failing after it freed pgp, it would set pgp to NULL and then
dereference it. This patch fixes that. Found by coverity.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: fix memory issue in path_latency prio
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:07 +0000 (18:03 -0500)]
libmultipath: fix memory issue in path_latency prio

The path_latency prioriziter was assuming that prepare_directio_read()
always succeeds. However, it doesn't, and when it fails, the prioritizer
used buf without it pointing to alloced memory. Found by coverity.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: remove unused code
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:06 +0000 (18:03 -0500)]
libmultipath: remove unused code

since vector_foreach_slot() already checks if the entry is NULL, there's
no point in checking it in the loop, since it can't be NULL there. Found
by coverity.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: _install_keyword cleanup
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:05 +0000 (18:03 -0500)]
libmultipath: _install_keyword cleanup

_install_keyword should use VECTOR_LAST_SLOT(), which has better error
checking. It should also fail if it gets a NULL pointer, instead of
dereferencing it. Found by coverity.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: fix length issues in get_vpd_sgio
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:04 +0000 (18:03 -0500)]
libmultipath: fix length issues in get_vpd_sgio

When get_vpd_sgio() finds out that the vpd info needed to be truncated
to fit in the buffer, it doesn't trucate the size as well,  which allows
it to overwrite the buffer. Also, in once len is set to -ENODATA,
get_vpd_sgio() should exit, instead of using the negative len in
memcpy(). Found by coverity.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: fix set_int error path
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:03 +0000 (18:03 -0500)]
libmultipath: fix set_int error path

set_int() wasn't checking if the line actually had a value before
converting it to an integer.  Found by coverity. Also, it should
be using set_value().

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: fix tur checker timeout issue
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:02 +0000 (18:03 -0500)]
libmultipath: fix tur checker timeout issue

If the tur checker is run, and the tur_thread has timed out,
libcheck_check() doesn't actually check if the thread is still running.
This means that the thread could have already completed successfully,
but the tur checker would still return PATH_TIMEOUT, instead of the
value returned by the thread. This patch makes libcheck_check() actually
check if the thread completed, and if so, it returns the proper value.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: cleanup tur locking
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:01 +0000 (18:03 -0500)]
libmultipath: cleanup tur locking

There are only three variables whose access needs to be synchronized
between the tur thread and the path checker itself: state, message, and
active.  The rest of the variables are either only written when the tur
thread isn't running, or they aren't accessed by the tur thread, or they
are atomics that are themselves used to synchronize things.

This patch limits the amount of code that is covered by ct->lock to
only what needs to be locked. It also makes ct->lock no longer a
recursive lock. To make this simpler, tur_thread now only sets the
state and message one time, instead of twice, since PATH_UNCHECKED
was never able to be returned anyway.

One benefit of this is that the tur checker thread gets more time to
call tur_check() and return before libcheck_check() gives up and
return PATH_PENDING.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: fix tur memory misuse
Benjamin Marzinski [Tue, 9 Oct 2018 23:03:00 +0000 (18:03 -0500)]
libmultipath: fix tur memory misuse

when tur_thread() was calling tur_check(), it was passing ct->message as
the copy argument, but copy_msg_to_tcc() was assuming that it was
getting a tur_checker_context pointer. This means it was treating
ct->message as ct. This is why the tur checker never printed checker
messages. Intead of simply changing the copy argument passed in, I just
removed all the copying code, since it is completely unnecessary. The
callers of tur_check() can just pass in a buffer that it is safe to
write to, and copy it later, if necessary.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: fix tur checker double locking
Benjamin Marzinski [Tue, 9 Oct 2018 23:02:59 +0000 (18:02 -0500)]
libmultipath: fix tur checker double locking

tur_devt() locks ct->lock. However, it is ocassionally called while
ct->lock is already locked. In reality, there is no reason why we need
to lock all the accesses to ct->devt. The tur checker only needs to
write to this variable one time, when it first gets the file descripter
that it is checking. This patch sets ct->devt in libcheck_init() when it
is first initializing the checker context. After that, ct->devt is only
ever read.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agolibmultipath: fix tur checker timeout
Benjamin Marzinski [Tue, 9 Oct 2018 23:02:58 +0000 (18:02 -0500)]
libmultipath: fix tur checker timeout

The code previously was timing out mode if ct->thread was 0 but
ct->running wasn't. This combination never happens.  The idea was to
timeout if for some reason the path checker tried to cancel the thread,
but it didn't die.  The correct thing to check for this is ct->holders.
ct->holders will always be at least one when libcheck_check() is called,
since libcheck_free() won't get called until the device is no longer
being checked. So, if ct->holders is 2, that means that the tur thread
is has not shut down yet.

Also, instead of timing out, the tur checker will switch to synchronous
mode.  The chance of this code path happening is very low.  I simply
exists because the old thread must not interfere with a new thread
starting up. But if something does go very wrong, and a thread does get
stuck, this solution will keep the checker from just ignoring the device
forever.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
9 months agokpartx: Use absolute paths to create mappings
Stef Walter [Sat, 6 Oct 2018 07:38:56 +0000 (09:38 +0200)]
kpartx: Use absolute paths to create mappings

kpartx -d now uses absolute paths to delete mappings, since the
commit 9bdfa3eb8e24b668e6c2bb882cddb0ccfe23ed5b. We should use
those same absolute paths to create the mappings.

Without this patch, the following workflow (as seen in the
manual page for kpartx) fails to actually remove the devices:

    # kpartx -av disk.img
    ...
    # kpartx -d disk.img

9 months agomultipath-tools: sync third-party headers with valgrind-3.14
Xose Vazquez Perez [Tue, 9 Oct 2018 22:37:14 +0000 (00:37 +0200)]
multipath-tools: sync third-party headers with valgrind-3.14

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM-DEV ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
9 months agolibmultipath: fix gcc 8.1 "truncated output" warnings
Martin Wilck [Mon, 8 Oct 2018 09:38:21 +0000 (11:38 +0200)]
libmultipath: fix gcc 8.1 "truncated output" warnings

gcc 8.1 was warning about a possibly truncated output in snprintf.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months ago(lib)mpathpersist: use O_RDONLY file descriptors
Martin Wilck [Mon, 8 Oct 2018 09:38:20 +0000 (11:38 +0200)]
(lib)mpathpersist: use O_RDONLY file descriptors

udevd catches close-after-write inotify events and generates "change"
uvents for such devices, which may cause extra unnecessary and unwanted
udev activity.

Therefore use O_RDONLY file descriptors for PRIN and PROUT commands. This
works just as well as O_WRONLY. sg_persist has supported the --readonly option
for years.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agolibmpathpersist: fix byte swapping for big endian systems
Martin Wilck [Mon, 8 Oct 2018 09:38:19 +0000 (11:38 +0200)]
libmpathpersist: fix byte swapping for big endian systems

The functions "mpath_reverse_uintXY_byteorder"  were apparently meant to
convert BE integers to native. This leads to wrong results on big-endian
systems. Make these functions use the get_unaligned_beXY API, and rename.

Also, remove the unused endianness test in mpath_pr_ioctl.c.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agomultipath-tools/tests: add tests for get_unaligned_beXX
Martin Wilck [Mon, 8 Oct 2018 09:38:18 +0000 (11:38 +0200)]
multipath-tools/tests: add tests for get_unaligned_beXX

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agolibmultipath: add (get|put)_unaligned_be64
Martin Wilck [Mon, 8 Oct 2018 09:38:17 +0000 (11:38 +0200)]
libmultipath: add (get|put)_unaligned_be64

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agolibmpathpersist: fix stack overflow in mpath_format_readfullstatus()
Martin Wilck [Mon, 8 Oct 2018 09:38:16 +0000 (11:38 +0200)]
libmpathpersist: fix stack overflow in mpath_format_readfullstatus()

Some storage arrays return corrupt data in response to READ FULL STATUS
PRIN commands. This may lead to stack overflow if the values aren't
sanitized.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agolibmpathpersist: fix typo in mpath_format_readfullstatus
Martin Wilck [Mon, 8 Oct 2018 09:38:15 +0000 (11:38 +0200)]
libmpathpersist: fix typo in mpath_format_readfullstatus

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agolibmpathpersist: remove duplicate test in readfullstatus
Martin Wilck [Mon, 8 Oct 2018 09:38:14 +0000 (11:38 +0200)]
libmpathpersist: remove duplicate test in readfullstatus

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agomultipath-tools: refresh kernel-doc from kernel sources
Xose Vazquez Perez [Sat, 18 Aug 2018 20:38:52 +0000 (22:38 +0200)]
multipath-tools: refresh kernel-doc from kernel sources

Cc: Gris Ge <fge@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM-DEV ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
9 months agomultipath-tools: tests/hwtable: test hidden devices
Martin Wilck [Tue, 2 Oct 2018 18:47:01 +0000 (20:47 +0200)]
multipath-tools: tests/hwtable: test hidden devices

Add a test for skipping "hidden" devices.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agomultipath/tests: fix hwtable tests after "hidden" support
Martin Wilck [Tue, 2 Oct 2018 18:47:00 +0000 (20:47 +0200)]
multipath/tests: fix hwtable tests after "hidden" support

The previous patch "libmultipath: pathinfo: skip hidden devices"
requires a change in the pathinfo mocking code. Otherwise the hwtable
tests will fail.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agomultipathd: try SCSI persistent reservations for SCSI only
Martin Wilck [Mon, 1 Oct 2018 18:45:07 +0000 (20:45 +0200)]
multipathd: try SCSI persistent reservations for SCSI only

This avoids error messages when PERSISTENT RESERVE IN ioctls
are tried on non-SCSI devices.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agolibmultipath: allow sysfs_pathinfo to return SKIPPED
Martin Wilck [Mon, 1 Oct 2018 18:45:06 +0000 (20:45 +0200)]
libmultipath: allow sysfs_pathinfo to return SKIPPED

The sysfs_pathinfo() code path can't distinguish between real
failure and a devices that have to be skipped. One example
for this are NVMe native multipath devices. This may cause
lots of irritating log messages.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agomultipathd: decrease log level of uevent messages
Martin Wilck [Fri, 14 Sep 2018 12:51:03 +0000 (14:51 +0200)]
multipathd: decrease log level of uevent messages

The messages "multipathd: add path (uevent)" etc. are displayed
frequently, and often for devices that don't matter for multipathd.
If real action needs to be taken, such as adding or removing paths
or maps from the internal structures, multipathd emits other log
messages at level 2 later on.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agomultipathd: fix version check for DM_DEV_ARM_POLL ioctl
Martin Wilck [Fri, 14 Sep 2018 12:51:02 +0000 (14:51 +0200)]
multipathd: fix version check for DM_DEV_ARM_POLL ioctl

Make sure the checks in dmevent_poll_supported() and
arm_dm_event_poll() use the same logic. Currently, the
version check check fails in arm_dm_event_poll() if
libdevmapper's DM_VERSION is newer than the kernel's.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agolibmultipath: pathinfo: skip hidden devices
Martin Wilck [Fri, 14 Sep 2018 12:51:01 +0000 (14:51 +0200)]
libmultipath: pathinfo: skip hidden devices

Hidden block devices (in practice: members of nvme native multipath
devices) can't be used by multipath anyway. Current multipath code
(with default blacklisting) skips them, too, but emits a misleading
"blacklisted: udev property missing" message.

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agolibmultipath: nvme: shorter topology output
Martin Wilck [Fri, 14 Sep 2018 12:51:00 +0000 (14:51 +0200)]
libmultipath: nvme: shorter topology output

The nvme foreign code maps the NVMe subsys NQN to the "%n"
wildcard ("alias"). Some real-world devices use very lengthy
expressions for the subsys NQN (counted 95 characters on one
system here), making the "multipath -ll" output hardly readable
for humans. Use a shorter and more concise printout instead,
based on the WWID only.

The subsys NQN is still available via the "%n" wildcard:
"multipathd show maps format %n".

Signed-off-by: Martin Wilck <mwilck@suse.com>
9 months agolibmultipath: nvme: fix path detection for kernel 4.16
Martin Wilck [Fri, 14 Sep 2018 12:50:59 +0000 (14:50 +0200)]
libmultipath: nvme: fix path detection for kernel 4.16

The path detection logic of the NVMe code relies on the "slaves"
symlinks from NVMe subsys to controllers in sysfs, which have
been removed in the 4.16 kernel.

With this patch, we use the symlinks on the NVMe subsys level
instead.

Example: a multipathed NVMe subsystem with 2 controllers:

/sys/devices/virtual/nvme-subsystem/nvme-subsys2/nvme2n1
/sys/devices/virtual/nvme-fabrics/ctl/nvme2/nvme2c6n1
/sys/devices/virtual/nvme-fabrics/ctl/nvme3/nvme2c8n1

The controllers are found from the subsystem like this:

/sys/devices/virtual/nvme-subsystem/nvme-subsys2/nvme2 ->
    ../../nvme-fabrics/ctl/nvme2
/sys/devices/virtual/nvme-subsystem/nvme-subsys2/nvme3 ->
    ../../nvme-fabrics/ctl/nvme3

Signed-off-by: Martin Wilck <mwilck@suse.com>
11 months agomultipath-tools: reformat maintainer info
Xose Vazquez Perez [Sun, 1 Jul 2018 15:55:38 +0000 (17:55 +0200)]
multipath-tools: reformat maintainer info

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM-DEV ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
11 months agomultipath-tools: update Hitachi maintainer email
Xose Vazquez Perez [Tue, 26 Jun 2018 13:52:31 +0000 (15:52 +0200)]
multipath-tools: update Hitachi maintainer email

Cc: Matthias Rudolph <Matthias.Rudolph@hitachivantara.com>
Cc: Matthias Rudolph <matthias.rudolph@hds.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM-DEV ML <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
11 months agokpartx: remove duplicated gpt validation check
Benjamin Marzinski [Wed, 1 Aug 2018 20:57:01 +0000 (15:57 -0500)]
kpartx: remove duplicated gpt validation check

The identical check exists twice in a row.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
11 months agokpartx: fix bad dm_devn return
Benjamin Marzinski [Wed, 1 Aug 2018 20:57:00 +0000 (15:57 -0500)]
kpartx: fix bad dm_devn return

dm_devn shouldn't be returning success if you can't create a dm task to
find the device info. Found by coverity.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
11 months agokpartx: Fix memory leak of uuid found by coverity
Benjamin Marzinski [Wed, 1 Aug 2018 20:56:59 +0000 (15:56 -0500)]
kpartx: Fix memory leak of uuid found by coverity

After the call to make_prefixed_uuid() allocs uuid, it must be freed if
dm_find_part() fails.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
11 months agokpartx: minor fixes to make coverity happy
Benjamin Marzinski [Wed, 1 Aug 2018 20:56:58 +0000 (15:56 -0500)]
kpartx: minor fixes to make coverity happy

an open() failure for fd_dasd will return -1, not 0. Also, cast blocksize
to a uint64_t to keep coverity from complaining about sign extension issues.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
11 months agompathpersist: add missing --param-rk usage info
Benjamin Marzinski [Wed, 1 Aug 2018 20:56:57 +0000 (15:56 -0500)]
mpathpersist: add missing --param-rk usage info

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
11 months agomultipath tests: add blacklist tests
Benjamin Marzinski [Wed, 1 Aug 2018 20:56:56 +0000 (15:56 -0500)]
multipath tests: add blacklist tests

These are tests to validate the filter_* blacklist functions. They not
only verify that the device is correctly blacklisted/whitelisted, but
they also verify the log messages that are printed out.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
11 months agomultipath tests: change to work with old make versions
Benjamin Marzinski [Wed, 1 Aug 2018 20:56:55 +0000 (15:56 -0500)]
multipath tests: change to work with old make versions

the $(file <) operation only works with make 4.2 and above. I tried
running the tests on an old machine and it failed. The $shell function
can do the same thing and multipath has been using that in its
Makefiles for a while.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
11 months agolibmultipath: remove _filter_* blacklist functions
Benjamin Marzinski [Wed, 1 Aug 2018 20:56:54 +0000 (15:56 -0500)]
libmultipath: remove _filter_* blacklist functions

The one point of these functions was for _filter_path(), and that wasn't
improved by using them. Since filter_path() only printed one message at
the end, you could have situations where the wwid was blacklisted, but
the blacklist message included the vendor/product instead. Also, the
protocol and property messages were printed twice, and if the device was
on multiple whitelists, only the last one is printed.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>