multipath-tools/.git
22 months agoBump version to 0.6.4 0.6.4
Christophe Varoqui [Thu, 3 Nov 2016 13:54:38 +0000 (14:54 +0100)]
Bump version to 0.6.4

22 months agoFix trailing whitespace in mpathpersist/main.c
Christophe Varoqui [Thu, 3 Nov 2016 13:47:03 +0000 (14:47 +0100)]
Fix trailing whitespace in mpathpersist/main.c

22 months agompathpersist:check variable 'conf' before using it
tang.wenji [Thu, 3 Nov 2016 03:32:15 +0000 (11:32 +0800)]
mpathpersist:check variable 'conf' before using it

If the variable 'conf' is NULL, the program should exit.

Signed-off-by: tang.wenji <tang.wenji@zte.com.cn>
22 months agomultipathd: remove unnecessary condition in check_path
PengLiang [Tue, 1 Nov 2016 08:14:31 +0000 (16:14 +0800)]
multipathd: remove unnecessary condition in check_path

The pp->mpp is an unnecessary condition. It will be return before this condition
if pp->mpp is NULL.

Signed-off-by: PengLiang <peng.liang5@zte.com.cn>
22 months agohwe_regmatch: match error
wei.huang [Fri, 14 Oct 2016 02:03:51 +0000 (10:03 +0800)]
hwe_regmatch: match error

Problem:
when we configure a device like vendor, product, revision all null in multipath.conf, hwe_regmatch always return 0.

Reasons:
\!hwe2->vendor, \!hwe2->product and \!hwe2->revision are all true.

Signed-off-by: wei.huang <huang.wei56@zte.com.cn>
22 months agoFix trailing whitespace in structs.c
Christophe Varoqui [Thu, 3 Nov 2016 13:42:48 +0000 (14:42 +0100)]
Fix trailing whitespace in structs.c

22 months agosegment faulty occured in add_feature()
wei huang [Tue, 1 Nov 2016 00:44:49 +0000 (08:44 +0800)]
segment faulty occured in add_feature()

Problem:
Multipathd segment faulty occured when device policy was configured in multipath.conf as follow:
#This is a device configuration just for COMPELNT device
devices {
       device {
               vendor                  COMPELNT
               dev_loss_tmo            120
               scheduler               deadline
       }
}

The call trace is:
Program received signal SIGSEGV, Segmentation fault.
0x00007f4eaaf49251 in __strstr_sse2 () from /lib64/libc.so.6
(gdb) bt
#0  0x00007f4eaaf49251 in __strstr_sse2 () from /lib64/libc.so.6
#1  0x00007f4eabba879c in add_feature (f=f@entry=0x211b248, n=n@entry=0x7f4eabbc530a queue_if_no_path)
    at structs.c:524
#2  0x00007f4eabba6993 in merge_hwe (src=0x2148c70, dst=0x211b220) at config.c:359
#3  factorize_hwtable (hw=0x214b800, n=n@entry=77) at config.c:452
#4  0x00007f4eabba7850 in load_config (file=file@entry=0x4144c8 /etc/multipath.conf) at config.c:651
#5  0x0000000000408959 in reconfigure (vecs=vecs@entry=0x2128ae0) at main.c:2078
#6  0x00000000004063c6 in child (param=0x0) at main.c:2483
#7  main (argc=<optimized out>, argv=<optimized out>) at main.c:2725
(gdb) up
#1  0x00007f4eabba879c in add_feature (f=f@entry=0x211b248, n=n@entry=0x7f4eabbc530a queue_if_no_path)
    at structs.c:524
524             if (strstr(*f, n))
(gdb) p *f
 = 0x0

Reasons:
When multipathd loads config, it will call merge_hwe() to merge the features between default_hw[] and config.
If the vender is not configured features in default_hw[], dst->features's value will be null. So strstr()'s first
parameter *f is null in add_feature(),too.

Signed-off-by: wei huang <huang.wei56@zte.com.cn>
22 months agokpartx: Move the declaration of a global variable from .c to .h
Bart Van Assche [Fri, 21 Oct 2016 18:46:58 +0000 (11:46 -0700)]
kpartx: Move the declaration of a global variable from .c to .h

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmultipath/checkers: Make the compiler check the checker function prototypes
Bart Van Assche [Fri, 21 Oct 2016 18:46:36 +0000 (11:46 -0700)]
libmultipath/checkers: Make the compiler check the checker function prototypes

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmultipath/prioritizers: Make getprio() prototypes consistent
Bart Van Assche [Fri, 21 Oct 2016 18:46:19 +0000 (11:46 -0700)]
libmultipath/prioritizers: Make getprio() prototypes consistent

Additionally, ensure that the compiler checks the getprio()
prototype.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agoUse NULL instead of 0 where a pointer is expected
Bart Van Assche [Fri, 21 Oct 2016 18:45:54 +0000 (11:45 -0700)]
Use NULL instead of 0 where a pointer is expected

This was detected by sparse.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmpathpersist: Move the definition of a global variable from .h to .c
Bart Van Assche [Fri, 21 Oct 2016 18:45:32 +0000 (11:45 -0700)]
libmpathpersist: Move the definition of a global variable from .h to .c

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmultipath: Move the definition of a global variable from .h to .c
Bart Van Assche [Fri, 21 Oct 2016 18:44:58 +0000 (11:44 -0700)]
libmultipath: Move the definition of a global variable from .h to .c

This change does not change the semantics of the code but makes
it easier for sparse to analyze the source code.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmultipath/checkers/rbd: Use unsigned int for one-bit bitfields
Bart Van Assche [Fri, 21 Oct 2016 18:44:31 +0000 (11:44 -0700)]
libmultipath/checkers/rbd: Use unsigned int for one-bit bitfields

Avoid that this bitfield is sign-extended. Detected by sparse.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmultipath: Remove an unused variable
Bart Van Assche [Fri, 21 Oct 2016 18:44:08 +0000 (11:44 -0700)]
libmultipath: Remove an unused variable

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmpathpersist: Remove an unused function
Bart Van Assche [Fri, 21 Oct 2016 18:43:50 +0000 (11:43 -0700)]
libmpathpersist: Remove an unused function

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmultipath: Remove an unused function
Bart Van Assche [Fri, 21 Oct 2016 18:43:31 +0000 (11:43 -0700)]
libmultipath: Remove an unused function

The function snprint_config() is not used. Hence remove it.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmultipath: Fix POLLIN checks
Bart Van Assche [Fri, 21 Oct 2016 18:43:11 +0000 (11:43 -0700)]
libmultipath: Fix POLLIN checks

Instead of testing (pfd.revents == 0) & 1, test whether
(pfd.revents & 1) == 0.

This has been detected by the sparse static analyzer.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmultipath: Move setup_thread_attr() from uevent.c into util.c
Bart Van Assche [Fri, 21 Oct 2016 18:42:42 +0000 (11:42 -0700)]
libmultipath: Move setup_thread_attr() from uevent.c into util.c

The setup_thread_attr() is not called by any code in source file
uevent.c. Hence move that function to source file util.c.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmultipath: Remove an incorrect comment
Bart Van Assche [Fri, 21 Oct 2016 18:42:19 +0000 (11:42 -0700)]
libmultipath: Remove an incorrect comment

It is easy to see that uevq_lockp is not held while service_uevq()
is called. Since no other code accesses the list that is processed
by this function calling service_uevq() without holding uevq_lockp
is safe. Hence remove the comment about locking above service_uevq().

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmultipath: Avoid that thread cancellation causes a hang
Bart Van Assche [Fri, 21 Oct 2016 18:41:56 +0000 (11:41 -0700)]
libmultipath: Avoid that thread cancellation causes a hang

Apparently uevq_stop() hangs every now and then in pthread_mutex_lock()
if the udev listener thread is canceled. Avoid this hang by removing
code from uevq_stop(). This is safe because uevq_stop() is only called
just before uevent_listen() returns and in that case neither clearing
my_uev_trigger nor signaling uev_condp is needed. Additionally, rename
uevq_stop() into uevent_cleanup() to make clear that its purpose is to
clean up resources and not to stop the uevent listener.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agolibmultipath: Make building against musl-libc again possible
Bart Van Assche [Fri, 21 Oct 2016 18:41:12 +0000 (11:41 -0700)]
libmultipath: Make building against musl-libc again possible

musl-libc does not support PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP.

This patch reverts commit 7884bde302ad ("multipathd: Avoid that a
deadlock is triggered sporadically during shutdown").

Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
22 months agomultipathd: "show map mpathx json" would cause realloc error possibly
10144149 [Wed, 2 Nov 2016 01:41:17 +0000 (09:41 +0800)]
multipathd: "show map mpathx json" would cause realloc error possibly

Problem: multipathd dead when we run "show map mpathx json" command with
system messages as follows:
Oct 13 11:37:30 rhel7-1 multipathd: *** Error in `/sbin/multipathd': realloc(): invalid next size: 0x00007f8cf8004210 ***
Oct 13 11:37:30 rhel7-1 multipathd: ======= Backtrace: =========
Oct 13 11:37:30 rhel7-1 multipathd: /lib64/libc.so.6(+0x7bc67)[0x7f8d06171c67]
Oct 13 11:37:30 rhel7-1 multipathd: /lib64/libc.so.6(+0x7fb17)[0x7f8d06175b17]
Oct 13 11:37:30 rhel7-1 multipathd: /lib64/libc.so.6(realloc+0xd2)[0x7f8d06176702]

Reasons: in function snprint_multipath_fields_json
vector_foreach_slot (pgp->paths, pp, j) {
       fwd += snprint_path(buff + fwd, len - fwd, PRINT_JSON_PATH, pp, 0);
       if (fwd > len)
            return fwd;

       fwd += snprint_json_elem_footer(buff + fwd,
                len - fwd, 3, j + 1 == VECTOR_SIZE(pgp->paths));
       if (fwd > len)
           return fwd;
}

snprint_path (char * line, int len, char * format, struct path * pp, int pad)

when len - fwd = 0 , The len is not restricted in snprint_path,and the Memory of line is
rewritten in snprint_path, it cause realloc() failed , so fwd > len modify
fwd >= len.

consider of ben’s advice, It would probably also be smart to change all the
          if (!TAIL)
lines to
  if (TAIL <= 0)
just as an extra precaution.

Other commands also have this type of risk.

Signed-off-by: 10144149 <tang.wenjun3@zte.com.cn>
22 months agomultipath-tools: clean up and organize libmpathpersist/mpath_persistent_reserve_...
Xose Vazquez Perez [Tue, 1 Nov 2016 12:48:56 +0000 (13:48 +0100)]
multipath-tools: clean up and organize libmpathpersist/mpath_persistent_reserve_{out,in}.3

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>
22 months agomultipath-tools: clean up and organize mpathpersist/mpathpersist.8
Xose Vazquez Perez [Mon, 31 Oct 2016 17:18:28 +0000 (18:18 +0100)]
multipath-tools: clean up and organize mpathpersist/mpathpersist.8

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>
22 months agoRemove duplicated code in mpath_alloc_prin_response()
ding.yemin [Mon, 31 Oct 2016 02:55:07 +0000 (10:55 +0800)]
Remove duplicated code in mpath_alloc_prin_response()

Remove duplicated code in mpath_alloc_prin_response().

Signed-off-by: ding.yemin <ding.yemin@zte.com.cn>
22 months agoset retrigger_tries to 0 for multipath
Benjamin Marzinski [Sat, 29 Oct 2016 02:55:26 +0000 (21:55 -0500)]
set retrigger_tries to 0 for multipath

Multipathd uses retrigger_tries to give udev more chances to to fill in
the uid_attribute, so that the path device is correctly set up in the
udev database. However the multipath command can't do this, so it should
just immediately give up on udev, and try to get the wwid directly.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
22 months agoadd disable_changed_wwids option
Benjamin Marzinski [Sat, 29 Oct 2016 02:55:25 +0000 (21:55 -0500)]
add disable_changed_wwids option

If a LUN on a storage device gets remapped while in-use by multipath,
it's possible that the multipath device will continue writing to this
new LUN, causing corruption.  This is not multipath's fault (users
should go remapping in-use LUNs), but it's possible for multipath to
detect this and disable IO to the device. If disable_changed_wwids
is set to "yes", multipathd will detect when a LUN changes wwids when it
receives the uevent for this, and will disable access to the device
until the LUN is mapped back.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
22 months agofix INIT_REQUESTED_UDEV code
Benjamin Marzinski [Sat, 29 Oct 2016 02:55:24 +0000 (21:55 -0500)]
fix INIT_REQUESTED_UDEV code

uev_update_path was not checking pp->initialized to see if multipathd
had requested that the path be reinitialized unless the path's read-only
state had changed.  This kept the reinitialization code from running in
most cases where it was supposed to. This patch reorders the function to
move that check outside the read-only status change code block. This
does mean that uev_update_path now always grabs the vecs lock, where
before it would only be grabbed if the read-only status had changed. If
people are worried about this, I can add some code to limit this so that
uev_update_path will only grab it if there is a chance that it needs to
reinitialize the path.

Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
22 months agorecover from errors in multipathd startup
Benjamin Marzinski [Sat, 29 Oct 2016 02:55:23 +0000 (21:55 -0500)]
recover from errors in multipathd startup

When multipathd does it's initial configuration during startup, it fails
the daemon for many errors that it would simply recover from if they
occured when adding paths or maps later.  It should recover from these
errors during startup as well.  Also, if multipathd hits a
nonrecoverable error, it should log a message before quitting.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
22 months agomultipath: set cookie before using it.
Benjamin Marzinski [Sat, 29 Oct 2016 02:55:22 +0000 (21:55 -0500)]
multipath: set cookie before using it.

dm_task_set_cookie() expects the cookie to be initialized when it is
called, but dm_rename() didn't initialized it, causing renames to fail
some of the time.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
22 months agompath: don't wait for udev if all paths are down
Benjamin Marzinski [Sat, 29 Oct 2016 02:55:21 +0000 (21:55 -0500)]
mpath: don't wait for udev if all paths are down

Normally multipath waits for udev to create a device before adding
more paths, which could trigger a reload. But, if the first path
discovered is not usable, you should add the next path right away.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
22 months agomultipathd: add "map failures" format wildcard
Benjamin Marzinski [Sat, 29 Oct 2016 02:55:20 +0000 (21:55 -0500)]
multipathd: add "map failures" format wildcard

This patch adds a new wildcard, 'x', for the "show maps format" command.
This wildcard show the number of map failures that have occurred. A map
failure is any time that the multipath device enters a state where it
has no paths and is not set to queue_if_no_paths. It can be used to see
if a multipath device was ever in a state were it could fail IO errors
up.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
22 months agodo not allow in-use path to change wwid
Benjamin Marzinski [Sat, 29 Oct 2016 02:55:19 +0000 (21:55 -0500)]
do not allow in-use path to change wwid

When a path is part of a multipath device, it must not change it's wwid.
If it can, when multipathd is reconfigured, you can end up with two
multipath devices owning the same path, eventually leading to a crash.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
22 months agokpartx.rules: respect skip_kpartx flag
Benjamin Marzinski [Sat, 29 Oct 2016 02:55:18 +0000 (21:55 -0500)]
kpartx.rules: respect skip_kpartx flag

Check if DM_SUBSYSTEM_UDEV_FLAG1 is set, and if so, don't run kpartx.
If the event was not generated by device-mapper, just use the existing
value of DM_SUBSYSTEM_UDEV_FLAG1.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
22 months agoFix a "space before tab in indent" warning
Christophe Varoqui [Thu, 3 Nov 2016 13:21:41 +0000 (14:21 +0100)]
Fix a "space before tab in indent" warning

22 months agolibmultipath: add skip_kpartx option
Benjamin Marzinski [Sat, 29 Oct 2016 02:55:17 +0000 (21:55 -0500)]
libmultipath: add skip_kpartx option

This option gives multipath the ability to stop kpartx from running. The
previous idea, the "no_partitions" feature, was not accepted in the
upstream kernel. This method uses one of the dm cookie subsystem flags
DM_SUBSYSTEM_UDEV_FLAG1, which can be checked by udev to skip running
kpartx when processing the event. This patch does most of the work
necessary to make this work.  It doesn't change kpartx.rules, however.

Also, if dm_suspend_and_flush_map fails, multipath doesn't know how the
device is configured. so, it simply checks if the device has any
partitions before attempting the remove, and if not, sets the
DM_SUBSYSTEM_UDEV_FLAG1 on the resume after failure, so that no
partitions will be generated.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
22 months agomultipath-tools: clean up and organize kpartx/kpartx.8
Xose Vazquez Perez [Fri, 28 Oct 2016 14:47:52 +0000 (16:47 +0200)]
multipath-tools: clean up and organize kpartx/kpartx.8

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>
22 months agomultipath-tools: clean up and organize multipathd/multipathd.8
Xose Vazquez Perez [Fri, 28 Oct 2016 13:48:46 +0000 (15:48 +0200)]
multipath-tools: clean up and organize multipathd/multipathd.8

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>
22 months agomultipath-tools: alua: replace lba state message
Xose Vazquez Perez [Thu, 27 Oct 2016 14:00:22 +0000 (16:00 +0200)]
multipath-tools: alua: replace lba state message

Change to "logical block dependent" as in spec.

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>
22 months agomultipath-tools: alua: add prefix with device name for asymmetric access state and...
Xose Vazquez Perez [Thu, 27 Oct 2016 13:21:10 +0000 (15:21 +0200)]
multipath-tools: alua: add prefix with device name for asymmetric access state and reported target port group messages

Before:
Oct 27 15:11:21 | reported target port group is 2
Oct 27 15:11:21 | aas = 01 [active/non-optimized]

After:
Oct 27 15:11:47 | sda: reported target port group is 2
Oct 27 15:11:47 | sda: aas = 01 [active/non-optimized]

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>
22 months agomultipath-tools: clean up and organize multipath/multipath.8
Xose Vazquez Perez [Thu, 27 Oct 2016 10:22:41 +0000 (12:22 +0200)]
multipath-tools: clean up and organize multipath/multipath.8

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>
22 months agomultipath-tools: alua: replace output for reserved return codes
Xose Vazquez Perez [Wed, 26 Oct 2016 17:23:24 +0000 (19:23 +0200)]
multipath-tools: alua: replace output for reserved return codes

Show an explicit error.
The current message could be misread, it is not related to the state of the port.

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>
22 months agomultipath-tools: add SUN ZFS Storage Appliances to hwtable
Xose Vazquez Perez [Wed, 26 Oct 2016 11:58:38 +0000 (13:58 +0200)]
multipath-tools: add SUN ZFS Storage Appliances to 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>
22 months agomultipath-tools: add StorageTek BladeStore to hwtable
Xose Vazquez Perez [Tue, 25 Oct 2016 23:25:28 +0000 (01:25 +0200)]
multipath-tools: add StorageTek BladeStore to 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>
22 months agoIdentify STK OPENstorage arrays
Christophe Varoqui [Thu, 3 Nov 2016 13:09:29 +0000 (14:09 +0100)]
Identify STK OPENstorage arrays

9176, D173, D178, D210, D220, D240 and D280

Rebase of a patch from Xose

22 months agomultipath-tools: identify STK/SUN array
Xose Vazquez Perez [Tue, 25 Oct 2016 21:01:32 +0000 (23:01 +0200)]
multipath-tools: identify STK/SUN array

FlexLine FLX380 was renamed to StorageTek 6540

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>
22 months agomultipath-tools: add support all STK OPENstorage rdac arrays
Xose Vazquez Perez [Tue, 25 Oct 2016 12:57:06 +0000 (14:57 +0200)]
multipath-tools: add support all STK OPENstorage rdac arrays

9176, D173, D178, D210, D220, D240 and D280.

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>
22 months agomultipath-tools: identify SUN/T4 as 6020 and 6120
Xose Vazquez Perez [Mon, 24 Oct 2016 13:19:09 +0000 (15:19 +0200)]
multipath-tools: identify SUN/T4 as 6020 and 6120

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>
22 months agomultipath-tools: identify more arrays in hwtable
Xose Vazquez Perez [Sun, 23 Oct 2016 21:51:02 +0000 (23:51 +0200)]
multipath-tools: identify more arrays in 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>
22 months agomultipath-tools: convert kpartx/lopart.c to UTF-8 to fix Arkadiusz's name
Xose Vazquez Perez [Sun, 23 Oct 2016 14:57:59 +0000 (16:57 +0200)]
multipath-tools: convert kpartx/lopart.c to UTF-8 to fix Arkadiusz's name

Cc: Arkadiusz Miśkiewicz <arekm@maven.pl>
Cc: Arkadiusz Miśkiewicz <misiek@pld.ORG.PL>
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>
22 months agomultipath-tools: add missing options and fix comments in hwtable's TEMPLATE
Xose Vazquez Perez [Sat, 22 Oct 2016 12:25:54 +0000 (14:25 +0200)]
multipath-tools: add missing options and fix comments in hwtable's TEMPLATE

and replace prio with its variable.

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>
22 months agomultipath-tools: replace pthread_yield with sched_yield
Xose Vazquez Perez [Thu, 20 Oct 2016 23:16:20 +0000 (01:16 +0200)]
multipath-tools: replace pthread_yield with sched_yield

pthread_yield is not standard.
It was added in 6e14b7b

Please review.

Patch from Alpine Linux: http://git.alpinelinux.org/cgit/aports/plain/main/multipath-tools/fix-yield.patch

Cc: Natanael Copa <ncopa@alpinelinux.org>
Cc: Leonardo Arena <rnalrd@alpinelinux.org>
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>
22 months agomultipath-tools: add Infortrend arrays to hwtable
Xose Vazquez Perez [Thu, 20 Oct 2016 16:52:57 +0000 (18:52 +0200)]
multipath-tools: add Infortrend arrays to hwtable

Based on info from manufacturer:
http://infortrend.com/ImageLoader/LoadDoc/385/True/True

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>
22 months agomultipath-tools: DF arrays were sold also under HP mark
Xose Vazquez Perez [Thu, 20 Oct 2016 13:21:41 +0000 (15:21 +0200)]
multipath-tools: DF arrays were sold also under HP mark

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>
22 months agomultipath-tools: add Promise arrays to hwtable
Xose Vazquez Perez [Wed, 19 Oct 2016 22:43:40 +0000 (00:43 +0200)]
multipath-tools: add Promise arrays to hwtable

and blacklist "VTrak V-LUN" also for ALUA.

Based on info from manufacturer:
https://downloadmirror.intel.com/18617/eng/RHEL6_MPIO_Setup.pdf
http://www.promise.com/media_bank/Download%20Bank/Utility/SUG_v0.85.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>
22 months agomultipath-tools: add DDN and rebranded arrays to hwtable
Xose Vazquez Perez [Wed, 19 Oct 2016 21:55:31 +0000 (23:55 +0200)]
multipath-tools: add DDN and rebranded arrays to 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>
23 months agomultipath-tools: replace static and define default values for config options
Xose Vazquez Perez [Wed, 19 Oct 2016 18:16:17 +0000 (20:16 +0200)]
multipath-tools: replace static and define default values for config options

Replace "const" by PRIO_CONST.
Replace static force_sync and partition_delim values, and define
DEFAULT_FORCE_SYNC and DEFAULT_PARTITION_DELIM

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>
23 months agomultipath-tools: integrate Changelog file in README and update it
Xose Vazquez Perez [Tue, 18 Oct 2016 23:34:22 +0000 (01:34 +0200)]
multipath-tools: integrate Changelog file in README and update it

and httpS for everyone.

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>
23 months agomultipath-tools: space \ at Makefile.inc
Xose Vazquez Perez [Tue, 18 Oct 2016 22:49:41 +0000 (00:49 +0200)]
multipath-tools: space \ at Makefile.inc

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>
23 months agomultipath-tools: replace hardcoded USER_FRIENDLY_NAMES_OFF by default
Xose Vazquez Perez [Tue, 18 Oct 2016 13:22:45 +0000 (15:22 +0200)]
multipath-tools: replace hardcoded USER_FRIENDLY_NAMES_OFF by default

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>
23 months agomultipath-tools: replace IO by I/O in multipath.conf.5
Xose Vazquez Perez [Mon, 17 Oct 2016 21:29:32 +0000 (23:29 +0200)]
multipath-tools: replace IO by I/O in multipath.conf.5

to be consistent with the rest of the text.

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>
23 months agomultipath-tools: clarify no_path_retry in multipath.conf.5
Xose Vazquez Perez [Mon, 17 Oct 2016 21:18:15 +0000 (23:18 +0200)]
multipath-tools: clarify no_path_retry in multipath.conf.5

no_path_retry    Specify what to do when all paths are down. Possible values are:

    value > 0   number of retries until disable I/O queueing.

    fail        for immediate failure (no I/O queueing).

    queue       for never stop I/O queueing. Similar to queue_if_no_path.

    See KNOWN ISSUES.

    Default value is: fail

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>
23 months agomultipath-tools: fix DEFAULT values
Xose Vazquez Perez [Mon, 17 Oct 2016 16:32:28 +0000 (18:32 +0200)]
multipath-tools: fix DEFAULT values

replace RR_WEIGHT_NONE with DEFAULT_RR_WEIGHT, and define DEFAULT_FLUSH

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>
23 months agomultipath-tools: replace static value with default_variable for flush_on_last_del
Xose Vazquez Perez [Mon, 17 Oct 2016 17:09:49 +0000 (19:09 +0200)]
multipath-tools: replace static value with default_variable for flush_on_last_del

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>
23 months agomultipathd/main.c: delete redundant judgment before LOG_MSG()
li.minghui [Tue, 18 Oct 2016 09:11:45 +0000 (17:11 +0800)]
multipathd/main.c: delete redundant judgment before LOG_MSG()

Problem:the LOG_MSG() doesn't note the path info "path offline" when the
path is in offline with the pp->offline = 1.

Reasons:There is no need to judge the strlen(b) again before calling
LOG_MSG(a, b) because there exists the judgmnet of strlen(b) in
defination of LOG_MSG(a,b).

23 months agoaccess vecs memory outside of locking range in check_path()
tang.junhui [Tue, 18 Oct 2016 02:51:08 +0000 (10:51 +0800)]
access vecs memory outside of locking range in check_path()

there are vecs->mpvec memory accesses outside of locking range in
check_path(), the judgments is not necessary since the they has
existed in vector_foreach_slot(), so delete them.

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
23 months agosegment faulty occured in dm_get_status()
tang.junhui [Tue, 18 Oct 2016 02:51:07 +0000 (10:51 +0800)]
segment faulty occured in dm_get_status()

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
segment faulty occured in dm_get_status(), the call trace is:
----------------------------------------------------------------------
(gdb) bt
0  0x000000338ec328a5 in raise () from /lib64/libc.so.6
1  0x000000338ec3400d in abort () from /lib64/libc.so.6
2  0x000000000040596d in sigsegv ()
3  <signal handler called>
4  0x000000338ec480ac in vfprintf () from /lib64/libc.so.6
5  0x000000338ec6f9d2 in vsnprintf () from /lib64/libc.so.6
6  0x000000338ec4f4a3 in snprintf () from /lib64/libc.so.6
7  0x00007f43fe66bbb9 in dm_get_status (name=0x7f43f0001eb0 "spathe",
outstatus=<value optimized out>) at devmapper.c:521
8  0x00007f43fe68c058 in update_multipath_status (mpp=0x7f43f000ad60,
pathvec=<value optimized out>) at structs_vec.c:465
9  update_multipath_strings (mpp=0x7f43f000ad60, pathvec=<value optimized
out>) at structs_vec.c:495
10 0x0000000000409056 in check_path ()
11 0x0000000000409c7e in checkerloop ()
12 0x0000003b27207851 in start_thread () from /lib64/libpthread.so.0
13 0x000000338ece890d in clone () from /lib64/libc.so.6
-----------------------------------------------------------------------
we debuged the code, and found that targets information storing in the
list dmt->head which fetching from kernel by executing dm_task_run()
is null.
-----------------------------------------------------------------------
rbx            0x7f43c4000d60   139929027874144
(gdb) p *(struct dm_task *)0x7f43c4000d60
$3 = {type = 10, dev_name = 0x7f43c4000d40 "spathe", head = 0x0, tail =
0x0, read_only = 0, event_nr = 0, major = -1, minor = -1,
  allow_default_major_fallback = 1, uid = 0, gid = 0, mode = 384,
  read_ahead = 4294967295, read_ahead_flags = 0, dmi = {
      v4 = 0x7f43c40011e0, v1 = 0x7f43c40011e0}, newname = 0x0, message =
      0x0, geometry = 0x0, sector = 0, no_flush = 0,
        no_open_count = 1, skip_lockfs = 0, query_inactive_table = 0,
suppress_identical_reload = 0, existing_table_size = 0,
  cookie_set = 0, uuid = 0x0}
-----------------------------------------------------------------------
since status is not initioned to null, so after calling
dm_get_next_target(dmt, next, &start, &length,&target_type,
&status),status becaming wild pointer, which lead snprintf() into the
situation of segment faulty.

23 months agomultipath-tools: release lock on handler failure
Michael Wang [Wed, 12 Oct 2016 08:54:05 +0000 (10:54 +0200)]
multipath-tools: release lock on handler failure

Inside parse_cmd() the pthread_cleanup_pop() rely on '!r' as the
indicator of locked or not, while this will be overwritten if the
handler return failed, and the unlock will be missing.

This will lead into the situation that all the following operation
will trying to hold a lock which will never be released.

This patch using a separate flag to record the status of locking to
make sure the unlock and lock are in pairs.

Signed-off-by: Michael Wang <yun.wang@profitbricks.com>
23 months agomultipath-tools: merge dcssblk in similar blacklist regex
Xose Vazquez Perez [Sun, 16 Oct 2016 13:59:46 +0000 (15:59 +0200)]
multipath-tools: merge dcssblk in similar blacklist regex

Similar patterns.

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>
23 months agomultipath-tools: use internal drd.h file
Xose Vazquez Perez [Sat, 8 Oct 2016 20:22:12 +0000 (22:22 +0200)]
multipath-tools: use internal drd.h file

Cc: Bart Van Assche <bart.vanassche@sandisk.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>
23 months agorbd: use lock_on_read if set
Mike Christie [Tue, 11 Oct 2016 21:36:55 +0000 (16:36 -0500)]
rbd: use lock_on_read if set

If lock_on_read is set initially, pass it as a map option
when remapping the image.

Signed-off-by: Mike Christie <mchristi@redhat.com>
23 months agorbd: fixup log messages
Mike Christie [Tue, 11 Oct 2016 21:36:54 +0000 (16:36 -0500)]
rbd: fixup log messages

Add rbd device prefix to condlog messages that was missing it, and drop
it in RBD_MSG because it is already added by caller.

Signed-off-by: Mike Christie <mchristi@redhat.com>
23 months agorbd: check for exclusive lock enabled
Mike Christie [Tue, 11 Oct 2016 21:36:53 +0000 (16:36 -0500)]
rbd: check for exclusive lock enabled

Only attach the checker if the rbd image has the exclusive lock
enabled.

Signed-off-by: Mike Christie <mchristi@redhat.com>
23 months agorbd: check for nonshared clients
Mike Christie [Tue, 11 Oct 2016 21:36:52 +0000 (16:36 -0500)]
rbd: check for nonshared clients

The rbd checker only supports nonshared clients so add a check
during init time.

Signed-off-by: Mike Christie <mchristi@redhat.com>
23 months agorbd: fix sync repair support
Mike Christie [Tue, 11 Oct 2016 21:36:51 +0000 (16:36 -0500)]
rbd: fix sync repair support

If sync was set we were calling check instead
of function passed in.

Signed-off-by: Mike Christie <mchristi@redhat.com>
23 months agomultipath-tools: add VIOLIN arrays to hardware table
Xose Vazquez Perez [Sat, 15 Oct 2016 11:50:23 +0000 (13:50 +0200)]
multipath-tools: add VIOLIN arrays to hardware table

Based on documentation provided by the manufacturer:
https://drive.google.com/open?id=0B_B6YmEmO7cDQlMzc1BsaUxZRVU

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>
23 months agomultipath-tools: add missing hardware handler to ALUA devices
Xose Vazquez Perez [Fri, 14 Oct 2016 16:44:59 +0000 (18:44 +0200)]
multipath-tools: add missing hardware handler to ALUA devices

Nimble/Server and TEGILE/(ZEBI-(FC|ISCSI)|INTELLIFLASH)

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>
23 months agomultipath-tools: add Xiotech ISE arrays to hwtable
Xose Vazquez Perez [Wed, 12 Oct 2016 16:06:37 +0000 (18:06 +0200)]
multipath-tools: add Xiotech ISE arrays to hwtable

Based on documentation provided by the manufacturer:
https://drive.google.com/file/d/0B_B6YmEmO7cDc201a3ZlcmFvUmM

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>
23 months agomultipathd: Avoid that a deadlock is triggered sporadically during shutdown
Bart Van Assche [Fri, 14 Oct 2016 15:35:47 +0000 (08:35 -0700)]
multipathd: Avoid that a deadlock is triggered sporadically during shutdown

pthread_cond_wait() is a thread cancellation point. If a thread that
is waiting in pthread_cond_wait() is canceled it is possible that the
mutex is re-acquired before the first cancellation cleanup handler
is called. In this case the cleanup handler is uevq_stop() and that
function locks uevq_lock. Avoid that calling uevq_stop() results in
a deadlock due to an attempt to lock a non-recursive mutex recursively.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
23 months agomultipathd: Avoid "socket operation on non-socket" errors
Bart Van Assche [Fri, 14 Oct 2016 15:34:26 +0000 (08:34 -0700)]
multipathd: Avoid "socket operation on non-socket" errors

Changing write_all() into write() is safe for files since the
POSIX standard guarantees that write() writes the entire buffer
except if the disk is full, a resource limit is encountered or
if interrupted by a signal. See also
http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html.

Fixes: commit 810082e7a8cf ("libmultipath, multipathd: Rework SIGPIPE handling")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
23 months agomultipathd: fail path when path check timeout
tang.junhui [Wed, 10 Aug 2016 08:10:38 +0000 (16:10 +0800)]
multipathd: fail path when path check timeout

path should be failed when path status is PATH_TIMEOUT after check,
otherwise, the valid number of paths in the map would be increased when
the path status is PATH_UP after the next turn check, which would cause
the valid number of paths exceeding the total number of paths in the map.

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
23 months agomultipathd: uxsock_timeout should be assigned by conf->uxsock_timeout
tang.junhui [Tue, 13 Sep 2016 10:08:49 +0000 (18:08 +0800)]
multipathd: uxsock_timeout should be assigned by conf->uxsock_timeout

uxsock_timeout should be assigned by conf->uxsock_timeout
before using it in uxclnt() as a CLI client timeout value,
otherwise its default value is 0, and the CLI client timeout
value is 0 + 100(ms), so the CLI client will be timeout very
quickly.

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
23 months agompathpersist: memset length is wrong
tang.junhui [Wed, 21 Sep 2016 08:44:46 +0000 (16:44 +0800)]
mpathpersist: memset length is wrong

variable transportids is cleared by memset() with wrong length MPATH_MX_TIDS,
the length should be MPATH_MX_TIDS*sizeof(struct transportid).

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
23 months agomultipath-tools: add NexGen arrays to hwtable
Xose Vazquez Perez [Fri, 7 Oct 2016 14:01:18 +0000 (16:01 +0200)]
multipath-tools: add NexGen arrays to hwtable

Based on info provided by the manufacturer.

Cc: Brian Auld <bauld@pivot3.com>
Cc: Bart Brooks <bbrooks@pivot3.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>
23 months agomultipath-tools: add Nexsan E-Series and SATABeast/SATABoy to hwtable
Xose Vazquez Perez [Sat, 8 Oct 2016 20:58:07 +0000 (22:58 +0200)]
multipath-tools: add Nexsan E-Series and SATABeast/SATABoy to hwtable

Based on documentation provided by the manufacturer:
http://support2.imation.com/downloads/nxs/crmkb5/Nexsan_Multipathing_Best_Practices_Guide.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>
23 months agomultipath-tools: add IBM/FlashSystem to hwtable
Xose Vazquez Perez [Fri, 7 Oct 2016 13:15:22 +0000 (15:15 +0200)]
multipath-tools: add IBM/FlashSystem to hwtable

System          Vendor Product          Multipathing Policy
=============== ====== ================ =======================
FlashSystem 710 IBM    FlashSystem      Symmetric Active/Active
FlashSystem 720 IBM    FlashSystem      Symmetric Active/Active
FlashSystem 810 IBM    FlashSystem      Symmetric Active/Active
FlashSystem 820 IBM    FlashSystem      Symmetric Active/Active
FlashSystem 840 IBM    FlashSystem-9840 Symmetric Active/Active
FlashSystem 900 IBM    FlashSystem-9840 Symmetric Active/Active

Based on documentation from the manufacturer:
http://www.redbooks.ibm.com/redbooks/pdfs/sg248271.pdf

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>
23 months agomultipath-tools: add Tegile arrays to hwtable
Xose Vazquez Perez [Thu, 6 Oct 2016 23:13:36 +0000 (01:13 +0200)]
multipath-tools: add Tegile arrays to hwtable

Based on documentation provided by the manufacturer:
http://pages.tegile.com/rs/568-BVY-995/images/Oracle%20BPG%201.0.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>
23 months agomultipath-tools: add Kaminario arrays to hwtable
Xose Vazquez Perez [Thu, 6 Oct 2016 22:36:55 +0000 (00:36 +0200)]
multipath-tools: add Kaminario arrays to hwtable

Based on a config provided by the manufacturer:
https://marc.info/?l=dm-devel&m=142683413902072

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>
23 months agomultipath-tools: add Nimble arrays to hwtable
Xose Vazquez Perez [Thu, 6 Oct 2016 21:57:48 +0000 (23:57 +0200)]
multipath-tools: add Nimble arrays to hwtable

Based on documentation provided by the manufacturer:
http://www.nimblestorage.com/bpg_nimble_storage_linux_fibre_channel.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>
23 months 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>
23 months 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>
23 months 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>
23 months 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>
23 months 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>
23 months 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

23 months 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>
23 months 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>
23 months 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>
23 months 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>