multipath-tools/.git
3 years agomultipath-tools: add INFINIDAT arrays to hwtable
Xose Vazquez Perez [Thu, 6 Oct 2016 21:09:14 +0000 (23:09 +0200)]
multipath-tools: add INFINIDAT arrays to hwtable

Based on documentation provided by the manufacturer:
https://support.infinidat.com/hc/en-us/articles/202319222

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agolibmultipath/checkers/tur: Fix a recently introduced deadlock
Bart Van Assche [Mon, 10 Oct 2016 23:12:28 +0000 (16:12 -0700)]
libmultipath/checkers/tur: Fix a recently introduced deadlock

Avoid that the tur_devt() call from libcheck_check() hangs.

Fixes: commit 873be9fef222 ("libmultipath/checkers/tur: Serialize tur_checker_context.devt accesses")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agomultipath-tools: add FUJITSU/ETERNUS 2000/4000/8000 to hwtable
Xose Vazquez Perez [Wed, 5 Oct 2016 21:12:52 +0000 (23:12 +0200)]
multipath-tools: add FUJITSU/ETERNUS 2000/4000/8000 to hwtable

Based on documentation provided by the manufacturer:
http://storage-system.fujitsu.com/global/manual/diskarray/pdf/p3am-3192-en.pdf

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: add HPE StoreVirtual 4000 family(LEFTHAND) to hwtable
Xose Vazquez Perez [Wed, 5 Oct 2016 21:00:14 +0000 (23:00 +0200)]
multipath-tools: add HPE StoreVirtual 4000 family(LEFTHAND) to hwtable

No official documentation, based on field-tested configuration:
https://www.citrix.com/blogs/2013/10/02/hp-p4000-multipath-config-file/
https://community.hpe.com/t5/HPE-StoreVirtual-Storage/StoreVirtual-4000-and-multipath-tools-Linux/m-p/6874775

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: add NetApp/SolidFir to hwtable
Xose Vazquez Perez [Wed, 5 Oct 2016 14:45:22 +0000 (16:45 +0200)]
multipath-tools: add NetApp/SolidFir to hwtable

Cc: PJ Waskiewicz <pj.waskiewicz@netapp.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agoFix the drd header location in the debug.c includes
Christophe Varoqui [Wed, 5 Oct 2016 06:45:07 +0000 (08:45 +0200)]
Fix the drd header location in the debug.c includes

3 years agoMakefile.inc: Enable -Wextra and -Wformat-nonliteral
Bart Van Assche [Tue, 4 Oct 2016 17:42:21 +0000 (10:42 -0700)]
Makefile.inc: Enable -Wextra and -Wformat-nonliteral

Instead of selecting some of the options enabled by -Wextra, enable
-Wextra and disable some of the options enabled by -Wextra. Enable
-Wformat-nonliteral.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath: Micro-optimize snprint_size()
Bart Van Assche [Tue, 4 Oct 2016 17:41:59 +0000 (10:41 -0700)]
libmultipath: Micro-optimize snprint_size()

Eliminate the stack array fmt[]. An interesting side effect of
this patch is that it makes it possible for the compiler to
verify whether the snprintf() arguments have a type that is
appropriate for the format string.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath/checkers/tur: Fix races on tur_checker_context.thread
Bart Van Assche [Tue, 4 Oct 2016 17:41:28 +0000 (10:41 -0700)]
libmultipath/checkers/tur: Fix races on tur_checker_context.thread

Avoid that pthread_cancel(ct->thread) can get called after the TUR
thread exited because this is not allowed for detached threads.
Avoid that data-race detection tools complain about reading ct->thread
without holding ct->hldr_lock.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath/checkers/tur: Serialize tur_checker_context.devt accesses
Bart Van Assche [Tue, 4 Oct 2016 17:41:11 +0000 (10:41 -0700)]
libmultipath/checkers/tur: Serialize tur_checker_context.devt accesses

Avoid that tur_checker_context.devt is accessed without holding
the tur_checker_context.lock mutex. This avoids that data race
detection tools complain about tur_checker_context.devt accesses.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath/checkers/tur: Protect tur_checker_context.message changes
Bart Van Assche [Tue, 4 Oct 2016 17:40:54 +0000 (10:40 -0700)]
libmultipath/checkers/tur: Protect tur_checker_context.message changes

Avoid that tur_checker_context.message is modified without holding
the tur_checker_context.lock mutex. This patch avoids that data
race detection tools like DRD complain about writing into
tur_checker_context.message.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath/checkers/tur: Move pthread_attr_destroy() call
Bart Van Assche [Tue, 4 Oct 2016 17:40:32 +0000 (10:40 -0700)]
libmultipath/checkers/tur: Move pthread_attr_destroy() call

Move the pthread_attr_destroy() call up such that this function
is also called if thread creation fails.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath/checkers/tur: Terminate a statement with a semicolon
Bart Van Assche [Tue, 4 Oct 2016 17:40:13 +0000 (10:40 -0700)]
libmultipath/checkers/tur: Terminate a statement with a semicolon

This patch does not affect any functionality but helps editors to
auto-indent the code below that statement correctly.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath/checkers/tur: Introduce strlcpy()
Bart Van Assche [Tue, 4 Oct 2016 17:39:53 +0000 (10:39 -0700)]
libmultipath/checkers/tur: Introduce strlcpy()

Change the strncpy() calls into strlcpy() calls instead of open-coding
strlcpy().

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agomultipathd: Fix a data race
Bart Van Assche [Tue, 4 Oct 2016 17:39:30 +0000 (10:39 -0700)]
multipathd: Fix a data race

Avoid that the path check interval initialization loop races with
other code that accesses the path vectors by executing that code
on the context of the main thread instead of the checker loop.
This patch avoids that DRD reports the following:

Conflicting store by thread 1 at 0x07f3f1f8 size 8
   at 0x40B50C: reconfigure (main.c:2014)
   by 0x40C2EC: child (main.c:2371)
   by 0x40CDA1: main (main.c:2609)
Address 0x7f3f1f8 is at offset 40 from 0x7f3f1d0. Allocation context:
   at 0x4C32995: calloc (in /usr/lib64/valgrind/vgpreload_drd-amd64-linux.so)
   by 0x5DDAC36: zalloc (memory.c:34)
   by 0x40B61A: init_vecs (main.c:2043)
   by 0x40BF01: child (main.c:2295)
   by 0x40CDA1: main (main.c:2609)

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agomultipathd: Suppress uninteresting data race reports
Bart Van Assche [Tue, 4 Oct 2016 17:39:09 +0000 (10:39 -0700)]
multipathd: Suppress uninteresting data race reports

The global variable multipath_conf is modified through RCU. Hence
avoid that the data race detection tools Helgrind and DRD report
data races for this variable.

The global variable running_state is read without holding the mutex
that protects changes of this variable. Suppress complaints about
these reads.

The global variable uxsock_timeout is not protected by any mutex.
Suppress complaints about using this variable.

Suppress complaints on reading conf->verbosity in dlog().

Add a copy of the necessary Valgrind header files to avoid that
valgrind-devel has to be installed to build the multipath-tools
software. These files have been obtained from
http://valgrind.org/downloads/valgrind-3.11.0.tar.bz2.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agomultipathd, libmultipathd: Make delays independent of clock jumps
Bart Van Assche [Tue, 4 Oct 2016 17:38:42 +0000 (10:38 -0700)]
multipathd, libmultipathd: Make delays independent of clock jumps

Time synchronization software like ntpd can adjust the clock
forwards and backwards. Avoid that the duration of a delay is
influenced by clock jumps initiated by time synchronization
software.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Mike Christie <mchristi@redhat.com>
3 years agolibmultipath/checkers/rbd: Declare local functions static
Bart Van Assche [Tue, 4 Oct 2016 17:38:15 +0000 (10:38 -0700)]
libmultipath/checkers/rbd: Declare local functions static

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Mike Christie <mchristi@redhat.com>
3 years agolibmultipath/checkers/tur: Declare local functions static
Bart Van Assche [Tue, 4 Oct 2016 17:37:50 +0000 (10:37 -0700)]
libmultipath/checkers/tur: Declare local functions static

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath/memory: Move an #include directive
Bart Van Assche [Tue, 4 Oct 2016 17:37:33 +0000 (10:37 -0700)]
libmultipath/memory: Move an #include directive

Minimize the number of #include directives in libmultipath/memory.h
by moving #include <assert.h> into libmultipath/memory.c.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath/prioritizers/ontap: Remove an unused #include directive
Bart Van Assche [Tue, 4 Oct 2016 17:36:59 +0000 (10:36 -0700)]
libmultipath/prioritizers/ontap: Remove an unused #include directive

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agomultipath-tools: add IBM/3552 (FAStT500) array
Xose Vazquez Perez [Tue, 4 Oct 2016 21:39:02 +0000 (23:39 +0200)]
multipath-tools: add IBM/3552 (FAStT500) array

Vendor doc: https://www.redbooks.ibm.com/redbooks/pdfs/sg246246.pdf
This also confirms that IBM/3542 (FAStT200) is really a RDAC device.
Both of them run the same firmware.

DS4200 tag is wrong.

Cc: Hannes Reinecke <hare@suse.de>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: remove pointless ".*" from devnode blacklists
Xose Vazquez Perez [Mon, 3 Oct 2016 15:53:20 +0000 (17:53 +0200)]
multipath-tools: remove pointless ".*" from devnode blacklists

".*" is useless at the end of a regex, and just "*" is a bug.
And document them.

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: merge emc and dell
Xose Vazquez Perez [Fri, 16 Sep 2016 17:37:20 +0000 (19:37 +0200)]
multipath-tools: merge emc and dell

There can be only one.

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: add Dell EMC Unity documentation
Xose Vazquez Perez [Fri, 16 Sep 2016 23:11:07 +0000 (01:11 +0200)]
multipath-tools: add Dell EMC Unity documentation

It's detected as DGC/VRAID

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: blacklist "Universal Xport" for IBM/3542
Xose Vazquez Perez [Mon, 3 Oct 2016 12:36:24 +0000 (14:36 +0200)]
multipath-tools: blacklist "Universal Xport" for IBM/3542

Cc: Hannes Reinecke <hare@suse.de>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years ago[libmultipath] Fix typo in hwtable
Christophe Varoqui [Mon, 3 Oct 2016 12:18:43 +0000 (14:18 +0200)]
[libmultipath] Fix typo in hwtable

s/MUTIBUS/MULTIBUS/

3 years ago[libmultipath] Don't use FAILBACK_UNDEF as a hwentry default
Christophe Varoqui [Mon, 3 Oct 2016 12:14:34 +0000 (14:14 +0200)]
[libmultipath] Don't use FAILBACK_UNDEF as a hwentry default

In the current code base, FAILBACK_UNDEF causes
need_switch_pathgroup() to refresh each path prio and mpp->bestpg,
and return to the caller it should switch pathgroup. But the caller
(check_path()) won't switch anyway.

FAILBACK_UNDEF never fails back automatically, like
FAILBACK_MANUAL, but causes unecessary work. So it should be used
as a hwentry default failback value.

3 years ago[libmultipath] Tweak defaults for some IBM hardware entries
Christophe Varoqui [Mon, 3 Oct 2016 12:03:48 +0000 (14:03 +0200)]
[libmultipath] Tweak defaults for some IBM hardware entries

Hannes confirmed:

* IBM 2105 is a fully symmetric array
=> switch pgpolicy to multibux

* IBM 3542 is a rdac family product
=> switch to rdac defaults

3 years agolibmultipath/checkers/{rbd,tur}: Fix pthread_cond_signal() calls
Bart Van Assche [Thu, 29 Sep 2016 21:28:27 +0000 (14:28 -0700)]
libmultipath/checkers/{rbd,tur}: Fix pthread_cond_signal() calls

Calling pthread_cond_signal() without holding the associated
mutex sporadically results in a lost wakeup. Hence call
pthread_cond_signal() while holding the mutex used by
pthread_cond_wait().

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Mike Christie <mchristi@redhat.com>
3 years agomultipath-tools: identify some IBM FlashSystem arrays
Xose Vazquez Perez [Fri, 19 Aug 2016 16:29:11 +0000 (18:29 +0200)]
multipath-tools: identify some IBM FlashSystem arrays

System             Vendor Product Multipathing Policy
================== ====== ======= ===================================================================
FlashSystem V840   IBM    2145    ALUA (1 Target Port Group per Controller)
FlashSystem V9000  IBM    2145    ALUA (1 Target Port Group per Controller)
FlashSystem A9000  IBM    2810XIV ALUA (All ports across all controllers in single Target Port Group)
FlashSystem A9000R IBM    2810XIV ALUA (All ports across all controllers in single Target Port Group)

Cc: Hannes Reinecke <hare@suse.de>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: replace queue_if_no_path with NO_PATH_RETRY_QUEUE
Xose Vazquez Perez [Thu, 18 Aug 2016 17:58:13 +0000 (19:58 +0200)]
multipath-tools: replace queue_if_no_path with NO_PATH_RETRY_QUEUE

Besides man page states: "If both values are specified the order
of precedence is no_path_retry, queue_if_no_path, dev_loss_tmo."

Thus remove queue_if_no_path where no_path_retry already was defined.

Cc: Hannes Reinecke <hare@suse.de>
Cc: Benjamin Marzinski <bmarzins@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: Add Dell SC name and maintainer
Sean McGinnis [Tue, 16 Aug 2016 14:08:39 +0000 (16:08 +0200)]
multipath-tools: Add Dell SC name and maintainer

Compellent Storage Center is now Dell SC Series storage. Added
contact name for maintenance.

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Sean McGinnis <sean_mcginnis@dell.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipathd: Change four threads from detached into joinable
Bart Van Assche [Thu, 18 Aug 2016 22:44:51 +0000 (15:44 -0700)]
multipathd: Change four threads from detached into joinable

Change the CLI listener, checker loop, uevent dispatcher and
uevent listener threads from detached into joinable threads.
This change is needed because calling pthread_join() is only
allowed for joinable threads.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Acked-by: dragan.stancevic@canonical.com
3 years agolibmultipath, rbd: Fix spelling in a source code comment
Bart Van Assche [Tue, 16 Aug 2016 20:02:52 +0000 (13:02 -0700)]
libmultipath, rbd: Fix spelling in a source code comment

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath, multipathd: Rework SIGPIPE handling
Bart Van Assche [Tue, 16 Aug 2016 20:08:03 +0000 (13:08 -0700)]
libmultipath, multipathd: Rework SIGPIPE handling

The behavior we want is as follows:
* If stdout or stderr is closed then SIGPIPE causes termination.
* Sending data to a socket that has been closed by the receiver
  does not cause multipathd to stop.

Hence unblock SIGPIPE and use MSG_NOSIGNAL when sending data over
a socket.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Benjamin Marzinski <bmarzins@redhat.com>
Cc: Gris Ge <fge@redhat.com>
3 years agoMakefile.inc: Remove -fexceptions from CFLAGS
Bart Van Assche [Tue, 16 Aug 2016 19:56:22 +0000 (12:56 -0700)]
Makefile.inc: Remove -fexceptions from CFLAGS

No code in the multipath-tools project calls a C++ function that
generates an exception. Hence remove -fexceptions. From the gcc
manual:

-fexceptions

  Enable exception handling. Generates extra code needed to
  propagate exceptions. For some targets, this implies GCC
  generates frame unwind information for all functions, which can
  produce significant data size overhead, although it does not
  affect execution. If you do not specify this option, GCC
  enables it by default for languages like C++ that normally
  require exception handling, and disables it for languages like
  C that do not normally require it. However, you may need to
  enable this option when compiling C code that needs to
  interoperate properly with exception handlers written in
  C++. You may also wish to disable this option if you are
  compiling older C++ programs that don't use exception handling.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agomultipath-tools: request to update man pages/TEMPLATE if "device subsection" keywords...
Xose Vazquez Perez [Sun, 28 Aug 2016 22:41:04 +0000 (00:41 +0200)]
multipath-tools: request to update man pages/TEMPLATE if "device subsection" keywords are changed

and s/keywork/keyword

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: Makefiles housekeeping
Xose Vazquez Perez [Sun, 28 Aug 2016 22:10:42 +0000 (00:10 +0200)]
multipath-tools: Makefiles housekeeping

replace mandir with man8dir and put KRNL variables in place.

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: replace LDFLAGS with LIBDEPS for groups of libraries in Makefiles
Xose Vazquez Perez [Tue, 16 Aug 2016 12:38:50 +0000 (14:38 +0200)]
multipath-tools: replace LDFLAGS with LIBDEPS for groups of libraries in Makefiles

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: add queue_mode to the features list in multipath/multipath.conf.5
Xose Vazquez Perez [Tue, 16 Aug 2016 12:38:53 +0000 (14:38 +0200)]
multipath-tools: add queue_mode to the features list in multipath/multipath.conf.5

New undocumented feature, added in e83068a5f:

    dm mpath: add optional "queue_mode" feature

    Allow a user to specify an optional feature 'queue_mode <mode>' where
    <mode> may be "bio", "rq" or "mq" -- which corresponds to bio-based,
    request_fn rq-based, and blk-mq rq-based respectively.

    If the queue_mode feature isn't specified the default for the
    "multipath" target is still "rq" but if dm_mod.use_blk_mq is set to Y
    it'll default to mode "mq".

    This new queue_mode feature introduces the ability for each multipath
    device to have its own queue_mode (whereas before this feature all
    multipath devices effectively had to have the same queue_mode).

Also add more info to other features.

Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: delete .minio from hwtable
Xose Vazquez Perez [Tue, 16 Aug 2016 12:38:52 +0000 (14:38 +0200)]
multipath-tools: delete .minio from hwtable

It's useless, default path_selector is service-time.
And document some aspects of round-robin.

Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Cc: Jun’ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Mike Christie <mchristi@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Benjamin Marzinski <bmarzins@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: replace queue-length by default selector
Xose Vazquez Perez [Tue, 16 Aug 2016 12:38:51 +0000 (14:38 +0200)]
multipath-tools: replace queue-length by default selector

service-time is more advanced, and it works better in asymmetric and
asymmetric environments.

Cc: Hannes Reinecke <hare@suse.de>
Cc: Benjamin Marzinski <bmarzins@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: document how to add devices that need special flags in the SCSI...
Xose Vazquez Perez [Tue, 16 Aug 2016 12:38:49 +0000 (14:38 +0200)]
multipath-tools: document how to add devices that need special flags in the SCSI subsystem

Full flags list at include/scsi/scsi_devinfo.h

Arrays controllers included currently:

 {"3PARdata", "VV", NULL, BLIST_REPORTLUN2},

 {"DEC", "HSG80", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD},
 {"HP", "A6189A", NULL, BLIST_SPARSELUN | BLIST_LARGELUN},
 {"COMPAQ", "MSA1000", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
 {"COMPAQ", "MSA1000 VOLUME", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
 {"COMPAQ", "HSV110", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD},
 {"HP", "HSV100", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD},
 {"COMPAQ", "LOGICAL VOLUME", NULL, BLIST_FORCELUN | BLIST_MAX_512},

 {"DDN", "SAN DataDirector", "*", BLIST_SPARSELUN},

 {"DGC", "RAID", NULL, BLIST_SPARSELUN},
 {"DGC", "DISK", NULL, BLIST_SPARSELUN}, <-- mising VDISK ??
 {"EMC", "SYMMETRIX", NULL, BLIST_SPARSELUN | BLIST_LARGELUN | BLIST_FORCELUN},
 {"EMC",  "Invista", "*", BLIST_SPARSELUN | BLIST_LARGELUN},

 {"FSC", "CentricStor", "*", BLIST_SPARSELUN | BLIST_LARGELUN},

 {"HITACHI", "OPEN-", "*", BLIST_REPORTLUN2},
 {"HP", "OPEN-", "*", BLIST_REPORTLUN2},

 {"HITACHI", "DF400", "*", BLIST_REPORTLUN2},
 {"HITACHI", "DF500", "*", BLIST_REPORTLUN2},
 {"HP", "DF400", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
 {"HP", "DF500", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
 {"HP", "DF600", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, <-- bug, also apply: 627511e3e

 {"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN},

 {"NETAPP", "LUN C-Mode", NULL, BLIST_SYNC_ALUA}, <-- ontap

 {"NETAPP", "INF-01-00", NULL, BLIST_SYNC_ALUA}, <-- rdac!!

 {"SGI", "TP9100", "*", BLIST_REPORTLUN2},

 {"Intel", "Multi-Flex", NULL, BLIST_NO_RSOC},

 {"SGI", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
 {"IBM", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
 {"SUN", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
 {"DELL", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: SCSI ML <linux-scsi@vger.kernel.org>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: use "+=" instead of only "=" for variables in Makefile
Xose Vazquez Perez [Fri, 12 Aug 2016 17:45:01 +0000 (19:45 +0200)]
multipath-tools: use "+=" instead of only "=" for variables in Makefile

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: add missing group of options in Makefiles
Xose Vazquez Perez [Fri, 12 Aug 2016 17:12:07 +0000 (19:12 +0200)]
multipath-tools: add missing group of options in Makefiles

And remove "-g", it's already in OPTFLAG

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: identify all four LCSM100_ devices
Xose Vazquez Perez [Sat, 13 Aug 2016 16:27:46 +0000 (18:27 +0200)]
multipath-tools: identify all four LCSM100_ devices

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: add two rdac devices
Xose Vazquez Perez [Sat, 13 Aug 2016 16:05:01 +0000 (18:05 +0200)]
multipath-tools: add two rdac devices

Sun StorEdge 6130 and SGI TP9700.

They were include in the kernel rdac side, but never in mpt:
https://bugzilla.redhat.com/524335
https://marc.info/?l=dm-devel&m=130203604024614

Cc: Sean Stewart <Sean.Stewart@netapp.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agoBump version to 0.6.3 0.6.3
Christophe Varoqui [Tue, 16 Aug 2016 07:36:45 +0000 (09:36 +0200)]
Bump version to 0.6.3

3 years agomultipath-tools: modify product regex in HDS devices
Xose Vazquez Perez [Thu, 11 Aug 2016 18:33:38 +0000 (20:33 +0200)]
multipath-tools: modify product regex in HDS devices

regex for product="DF" is tooooo wide.
Also changed for VSP to "^OPEN-"

I asked Matthias before make this change.

Cc: Matthias Rudolph <Matthias.Rudolph@hds.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: move code up in Makefile
Xose Vazquez Perez [Thu, 11 Aug 2016 18:33:37 +0000 (20:33 +0200)]
multipath-tools: move code up in Makefile

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: delete failback from IBM/2810XIV
Xose Vazquez Perez [Thu, 11 Aug 2016 18:32:25 +0000 (20:32 +0200)]
multipath-tools: delete failback from IBM/2810XIV

nonsense with multibus as path_grouping_policy

Cc: Hannes Reinecke <hare@suse.de>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: add KOVE/XPD to hwtable
Xose Vazquez Perez [Thu, 11 Aug 2016 18:32:24 +0000 (20:32 +0200)]
multipath-tools: add KOVE/XPD to hwtable

Info provided directly by the manufacturer: http://kove.net/xpd

Cc: Nick Russo <nick.russo@kove.net>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: move DEFAULT_PRIO DEFAULT_PRIO_ARGS and DEFAULT_CHECKER to libmultip...
Xose Vazquez Perez [Thu, 11 Aug 2016 18:32:23 +0000 (20:32 +0200)]
multipath-tools: move DEFAULT_PRIO DEFAULT_PRIO_ARGS and DEFAULT_CHECKER to libmultipath/defaults.h

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: request to update man pages if the code is changed
Xose Vazquez Perez [Thu, 11 Aug 2016 18:32:22 +0000 (20:32 +0200)]
multipath-tools: request to update man pages if the code is changed

Please, document the changes.

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: delete IBM/1745 ghost array
Xose Vazquez Perez [Thu, 11 Aug 2016 18:32:21 +0000 (20:32 +0200)]
multipath-tools: delete IBM/1745 ghost array

There is no references nowhere.
Confirmed by the original manufacturer(NetApp), and Google shows no results.

Cc: Sean Stewart <Sean.Stewart@netapp.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: Edward Goggin no longer works at EMC
Xose Vazquez Perez [Thu, 11 Aug 2016 18:32:20 +0000 (20:32 +0200)]
multipath-tools: Edward Goggin no longer works at EMC

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: Makefiles housekeeping
Xose Vazquez Perez [Thu, 11 Aug 2016 18:32:19 +0000 (20:32 +0200)]
multipath-tools: Makefiles housekeeping

Apart of this relevant change in libmpathpersist/Makefile
-       $(CC) -Wall -fPIC -c $(CFLAGS) *.c
+       $(CC) -c $(CFLAGS) *.c

Mainly indent and order code.

Compiled tested, also installed and uninstalled.

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: minor edit of multipath/multipath.conf.5
Xose Vazquez Perez [Thu, 11 Aug 2016 18:32:18 +0000 (20:32 +0200)]
multipath-tools: minor edit of multipath/multipath.conf.5

Split long lines, and change a text from place.

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: document the relation between queue_if_no_path and no_path_retry
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:38 +0000 (18:20 +0200)]
multipath-tools: document the relation between queue_if_no_path and no_path_retry

Also mark queue_if_no_path as deprecated.

Cc: Hannes Reinecke <hare@suse.de>
Cc: Benjamin Marzinski <bmarzins@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: document vendor, product, revision and bl_product are POSIX Extended...
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:36 +0000 (18:20 +0200)]
multipath-tools: document vendor, product, revision and bl_product are POSIX Extended regex

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: remove patchwork reference
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:35 +0000 (18:20 +0200)]
multipath-tools: remove patchwork reference

It is only for kernel dm patches.

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: add IBM/1813 - DCS3860 to hwtable
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:34 +0000 (18:20 +0200)]
multipath-tools: add IBM/1813 - DCS3860 to hwtable

It's a RDAC device, confirmed by the original manufacturer(NetApp).

Cc: Sean Stewart <Sean.Stewart@netapp.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: standardize all RDAC devices
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:32 +0000 (18:20 +0200)]
multipath-tools: standardize all RDAC devices

This is a combo patch.

Reorder keyworks as in code and manpage for "(NETAPP|LSI|ENGENIO)"/"INF-01-00",
and clone its configuration to ALL other RDAC devices.

There are only two differences in all rdac devices. And they look minor:
.features and .no_path_retry

 devices                keyword          values
 =======                ==============   ====================
      3                 .features      = "1 queue_if_no_path",

      5                 .no_path_retry = 15,
      1                 .no_path_retry = 30,
      3                 .no_path_retry = 300,
     10                 .no_path_retry = NO_PATH_RETRY_QUEUE,

"queue_if_no_path" is identical to the "no_path_retry" keyword.
So "queue_if_no_path" can be replaced by "no_path_retry = XX"

And there are just six devices with:
      6                 .features      = "2 pg_init_retries 50",

Sean Stewart, from NetApp, provided more detailed information:

"The pg_init_retries value should be good for all RDAC devices, and can be
synced, the no_path_retry should also be fine. I don’t think that there’s
necessarily an “ideal” value for it, and may be more of a user preference type
of thing, but I personally don’t see anything wrong with having that value on
all RDAC devices, as well. It’s easy enough to change in the conf file if an end
user needs a different value."

I think the pg_init_retries parameter is set as such because part of
scsi_dh_rdac’s path activation involves sending a Mode Select page 0x2C to
change the ownership. If the array is already processing one, it will return
with a vendor unique check condition (05/91/36), which returns SCSI_DH_RETRY."

As for the no_path_retry, we’ve seen scenarios where both paths can be
temporarily unavailable during a storage firmware upgrade, usually because udev
processing has not added the path from one controller before the path from the
second controller goes away. This is just to give it some time to settle in
cases like that, so I/O can continue. The value of 30 was suggested by my
predecessor, but I think is largely arbitrary."

Cc: Sean Stewart <Sean.Stewart@netapp.com>
Cc: Benjamin Marzinski <bmarzins@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: remove blank line at multipath.conf.5
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:31 +0000 (18:20 +0200)]
multipath-tools: remove blank line at multipath.conf.5

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: add Oracle FS to hwtable
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:30 +0000 (18:20 +0200)]
multipath-tools: add Oracle FS to hwtable

Based on info from the manufacturer.
And also add ^ to Axiom.

Cc: Srinivasan Ramani <srinivas.ramani@oracle.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: SGI/TP9300 is a RDAC array
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:29 +0000 (18:20 +0200)]
multipath-tools: SGI/TP9300 is a RDAC array

Confirmed by the original manufacturer(NetApp).

Cc: Sean Stewart <Sean.Stewart@netapp.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: replace "." for real values in (COMPAQ|HP)/"(MSA|HSV)1.0"
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:28 +0000 (18:20 +0200)]
multipath-tools: replace "." for real values in (COMPAQ|HP)/"(MSA|HSV)1.0"

Exact devices are in drivers/scsi/scsi_dh.c

        {"COMPAQ", "MSA1000 VOLUME",    "hp_sw" },
        {"COMPAQ", "HSV110",            "hp_sw" },
        {"HP",     "HSV100",            "hp_sw"},

Cc: Hannes Reinecke <hare@suse.de>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: replace spaces with a regex in IBM/"3303 NVDISK"
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:27 +0000 (18:20 +0200)]
multipath-tools: replace spaces with a regex in IBM/"3303 NVDISK"

Replace six spaces with any number of them.
Exact regex is "3303[ ]{6,6}NVDISK", but it looks too overloaded.

Tested with a regex checker from:
http://eli.thegreenplace.net/2012/11/14/some-notes-on-posix-regular-expressions

Cc: Brian King <brking@linux.vnet.ibm.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: replace (|) with [] when there is one element
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:26 +0000 (18:20 +0200)]
multipath-tools: replace (|) with [] when there is one element

Cc: Hannes Reinecke <hare@suse.de>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: remove pgpolicy=FAILOVER from Ceph/RBD
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:25 +0000 (18:20 +0200)]
multipath-tools: remove pgpolicy=FAILOVER from Ceph/RBD

It's already the default pgpolicy.

Cc: Mike Christie <mchristi@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: identify more devices at hwtable
Xose Vazquez Perez [Wed, 10 Aug 2016 16:20:24 +0000 (18:20 +0200)]
multipath-tools: identify more devices at hwtable

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: add support for all IBM Enterprise Storage Server / Shark family
Xose Vazquez Perez [Thu, 11 Aug 2016 18:32:17 +0000 (20:32 +0200)]
multipath-tools: add support for all IBM Enterprise Storage Server / Shark family

Only F20 and 800 were included:
2105F20 IBM Enterprise Storage Server Model F20
2105800 IBM TotalStorage Enterprise Storage Server Model 800

Added all of them with just "^2105"
2105E10 IBM Enterprise Storage Server Model E10
2105E20 IBM Enterprise Storage Server Model E20
2105F10 IBM Enterprise Storage Server Model F10
2105750 IBM TotalStorage Enterprise Storage Server Model 750

Cc: Hannes Reinecke <hare@suse.de>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agolibmultipath: fix memory API logic error
tang.junhui [Tue, 16 Aug 2016 01:55:32 +0000 (09:55 +0800)]
libmultipath: fix memory API logic error

Memroy API use mem_allocated to record the total size of used memory,
however, it's wrong to use size(p) as the length of freed memory in xfree(),
and memory may also be allocated by STRDUP() or REALLOC(), which is
not calculated into mem_allocated, so the total size of used memory is
not correctly. For these reasons, we removed these incorrectly code to keep
the code clean.

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
3 years agolibmultipath: retry to get path serial number by get_serial() after failure by get_vp...
tang.junhui [Fri, 12 Aug 2016 03:43:56 +0000 (11:43 +0800)]
libmultipath: retry to get path serial number by get_serial() after failure by get_vpd_sysfs()

Some operating systems have no such file vpd_pg80 in sys directory
such as /sys/devices/platform/host23/session21/target23:0:0/23:0:0:33/,
so path serial number would be failed to get by get_vpd_sysfs(),
we need retry to get it by get_serial to avoid empty serial of the path.

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
3 years agomultipathd: fix some small bugs for cli socket
tang.junhui [Thu, 11 Aug 2016 11:01:20 +0000 (19:01 +0800)]
multipathd: fix some small bugs for cli socket

1) mpath_recv_reply_len() should return error when the length which received by read_all() is wrong;
2) The buffer which *reply point to maybe null when mpath_recv_reply() return with success,
   so the caller needs to determine whether it is null, and then to use
   it.

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
3 years agomultipathd: Remove a busy-waiting loop
Bart Van Assche [Mon, 15 Aug 2016 15:28:29 +0000 (08:28 -0700)]
multipathd: Remove a busy-waiting loop

Use pthread_join() to wait until worker threads have finished
instead of using a counter to keep track of how many threads are
trying to grab a mutex. Remove mutex_lock.depth since this member
variable is no longer needed.

This patch fixes two race conditions:
* Incrementing "depth" in lock() without holding a mutex.
* Destroying a mutex from the main thread without waiting for the
  worker threads to finish using that mutex.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath: Introduce timedlock()
Bart Van Assche [Mon, 15 Aug 2016 15:27:19 +0000 (08:27 -0700)]
libmultipath: Introduce timedlock()

Introduce the function timedlock(). Ensure that the value of the
"depth" member value is incorrect if pthread_mutex_timedlock()
times out.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath: Inline mutex in struct mutex_lock
Bart Van Assche [Mon, 15 Aug 2016 15:27:01 +0000 (08:27 -0700)]
libmultipath: Inline mutex in struct mutex_lock

This simplifies the struct mutex_lock allocation and deallocation
code.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath: Convert lock() and unlock() into inline functions
Bart Van Assche [Mon, 15 Aug 2016 15:26:39 +0000 (08:26 -0700)]
libmultipath: Convert lock() and unlock() into inline functions

Convert lock() and unlock() from macros into inline functions.
This conversion makes it possible for the compiler to perform
type checking on the lock() and unlock() arguments. However,
this makes it necessary to change the argument type from "struct
mutex_lock" into "struct mutex_lock *".

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath: Remove debugging code from lock.h
Bart Van Assche [Mon, 15 Aug 2016 15:26:15 +0000 (08:26 -0700)]
libmultipath: Remove debugging code from lock.h

There are better tools available to trace mutex lock and unlock
activity than the macros in this header file, e.g.
valgrind --tool=drd --trace-mutex=yes multipathd -d
Hence remove the debugging macros.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agolibmultipath: Remove a data structure that has been commented out
Bart Van Assche [Mon, 15 Aug 2016 15:25:58 +0000 (08:25 -0700)]
libmultipath: Remove a data structure that has been commented out

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
3 years agomultipathd: Don't call repair on blacklisted paths
Mike Christie [Mon, 15 Aug 2016 17:13:46 +0000 (12:13 -0500)]
multipathd: Don't call repair on blacklisted paths

This fixes a regression added in
015f87b16a7797a17afd514aec46e65c2a1a2f73

If a path is blacklisted the checkerloop will free the path so
don't call repair on it.

This moves the repair call down into check_path, because I think
we also do not need to call it for other cases where we cannot get
the uuid info or being orphaned.

Signed-off-by: Mike Christie <mchristi@redhat.com>
3 years agomultipath-tools: check for initialized checker before
Mike Christie [Mon, 15 Aug 2016 17:13:45 +0000 (12:13 -0500)]
multipath-tools: check for initialized checker before

This fixes a regression added with:
015f87b16a7797a17afd514aec46e65c2a1a2f73

We can hit a race where when pathinfo is setting up a path, the path
could have gone down already. In the DI_CHECKER chunk we then do not run
get_state and attach a checker. Later when check_path is run
path_offline could still return PATH_DOWN or PATH_REMOVED and
get_state is again not run so we do not get to attach a checker. I
was then running repair_path since the state was PATH_DOWN, and we then
hit a segfault.

This has us test if a checker is selected before running repair.

Signed-off-by: Mike Christie <mchristi@redhat.com>
3 years agomultipathd: fix memory allocation logic error for polls in uxsock_listen()
tang.junhui [Wed, 10 Aug 2016 09:32:40 +0000 (17:32 +0800)]
multipathd: fix memory allocation logic error for polls in uxsock_listen()

logic error exists in memory allocation for polls in uxsock_listen(), even if the allocated memory size meet the needs, it is still to realloc memory, which is not up to expectations.

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
3 years agomultipath-tools: Add rbd to the hwtable
Mike Christie [Mon, 8 Aug 2016 12:01:50 +0000 (07:01 -0500)]
multipath-tools: Add rbd to the hwtable

Add rbd to hwtable. These defaults are for the HA type of setup
supported by the checker. We do no support features like multibus
at the dm-multipath level yet.

Changes since v1:
1. Drop settings that were defaults and follow template.
2. Drop ID_UID use.

Signed-off-by: Mike Christie <mchristi@redhat.com>
3 years agomultipath-tools: Add rbd checker.
Mike Christie [Mon, 8 Aug 2016 12:01:49 +0000 (07:01 -0500)]
multipath-tools: Add rbd checker.

This checker currently only handles the case where a path is failed
due to it being blacklisted by the ceph cluster. The specific use
case for me is when LIO exports rbd images through multiple LIO
instances.

The problem it handles is when rbd instance1 has the exclusive lock,
but becomes unreachable another host in the cluster will take over
and blacklist the instance1. This prevents it from sending stale IO
and corrupting data.

Later, when the host is reachable, we will want to failback to it.
To this, the checker will detect we were blacklisted, unmap the old
image which will make sure old IO is failed, and then remap the image
and unblacklist the host. multipathd will then handle this like a
path being removed and re-added.

Changes since v1:
1. Call the rbd command to remap images instead of trying to interact
with sysfs directly. This fixes ceph auth issues hit when using the
sysfs interface directly.

We currently do not support rbd root/boot. When that is supported we
will have a lib to interact with the kernel and we can then convert
to it.

Signed-off-by: Mike Christie <mchristi@redhat.com>
3 years agomultipath-tools: add checker callout to repair path
Mike Christie [Mon, 8 Aug 2016 12:01:48 +0000 (07:01 -0500)]
multipath-tools: add checker callout to repair path

This patch adds a callback which can be used to repair a path
if check() has determined it is in the PATH_DOWN state.

The next patch that adds rbd checker support which will use this to
handle the case where a rbd device is blacklisted.

Signed-off-by: Mike Christie <mchristi@redhat.com>
3 years agolibmultipath: add rbd discovery
Mike Christie [Mon, 8 Aug 2016 12:01:47 +0000 (07:01 -0500)]
libmultipath: add rbd discovery

rbd is a block device interface for Ceph. It does not support
any SCSI commands, so this patch adds bus detection and virtual
vendor/product pathinfo.

Changes since v1:
1. Drop ID_UID use and implemented sysfs getuid support.

Signed-off-by: Mike Christie <mchristi@redhat.com>
3 years agomultipath: fixup check for out-of-scope maps
Hannes Reinecke [Tue, 9 Aug 2016 07:31:13 +0000 (09:31 +0200)]
multipath: fixup check for out-of-scope maps

The 'wwid' in struct multipath is a static array, so a check for
the existence of 'wwid' is pointless. We should rather check if
the argument 'refwwid' is not NULL and has a length larger then '0'.

Signed-off-by: Hannes Reinecke <hare@suse.com>
3 years agolibmultipath/parser.c: correctly terminate buffer
Hannes Reinecke [Tue, 9 Aug 2016 07:31:12 +0000 (09:31 +0200)]
libmultipath/parser.c: correctly terminate buffer

The code would be returning a static NULL buffer instead of
terminating the original buffer.

Signed-off-by: Hannes Reinecke <hare@suse.com>
3 years agolibmultipath/discovery.c: use 'unsigned long' instead of 'unsigned int'
Hannes Reinecke [Tue, 9 Aug 2016 07:31:11 +0000 (09:31 +0200)]
libmultipath/discovery.c: use 'unsigned long' instead of 'unsigned int'

We should be using 'unsigned long' for the variable preferred.

Signed-off-by: Hannes Reinecke <hare@suse.com>
3 years agomultipath-tools: more fixes for multipath.conf.5
Xose Vazquez Perez [Sat, 6 Aug 2016 22:40:08 +0000 (00:40 +0200)]
multipath-tools: more fixes for multipath.conf.5

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: identify arrays at multipath.conf.5
Xose Vazquez Perez [Sat, 6 Aug 2016 22:40:07 +0000 (00:40 +0200)]
multipath-tools: identify arrays at multipath.conf.5

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: random fixes in multipath.conf.5
Xose Vazquez Perez [Sat, 6 Aug 2016 22:40:06 +0000 (00:40 +0200)]
multipath-tools: random fixes in multipath.conf.5

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: add dots(spaces) between sections and keywords
Xose Vazquez Perez [Sat, 6 Aug 2016 22:40:05 +0000 (00:40 +0200)]
multipath-tools: add dots(spaces) between sections and keywords

Cleaner layout.

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: stand out sections headings with comments at multipath.conf.5
Xose Vazquez Perez [Sat, 6 Aug 2016 22:40:04 +0000 (00:40 +0200)]
multipath-tools: stand out sections headings with comments at multipath.conf.5

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: replace ".I" with \fIxxx\R at multipath.conf.5
Xose Vazquez Perez [Sat, 6 Aug 2016 22:40:03 +0000 (00:40 +0200)]
multipath-tools: replace ".I" with \fIxxx\R at multipath.conf.5

Leave ".I" only for values of keywords, now the layout is clearer. Also correct
some minor inconsistencies.

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: remove "Optional" from some attributes in multipath.conf.5
Xose Vazquez Perez [Sat, 6 Aug 2016 22:40:02 +0000 (00:40 +0200)]
multipath-tools: remove "Optional" from some attributes in multipath.conf.5

Mandatory ones were already identified. Optional is redundant.

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
3 years agomultipath-tools: revert add VIOLIN/CONCERTO ARRAY to hardware table
Xose Vazquez Perez [Sat, 6 Aug 2016 09:59:33 +0000 (11:59 +0200)]
multipath-tools: revert add VIOLIN/CONCERTO ARRAY to hardware table

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>