multipath-tools/.git
4 years agomultipath-tools: replace rm with a variable in makefiles
Xose Vazquez Perez [Fri, 1 Jul 2016 17:17:28 +0000 (19:17 +0200)]
multipath-tools: replace rm with a variable 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>
4 years agomultipath-tools: replace COPYING with a fresh copy from gnu.org
Xose Vazquez Perez [Thu, 30 Jun 2016 14:39:53 +0000 (16:39 +0200)]
multipath-tools: replace COPYING with a fresh copy from gnu.org

https://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt
Same licence and version, with some corrections(mainly fsf address)

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>
4 years agomultipath-tools: replace FSF address with a www pointer
Xose Vazquez Perez [Thu, 30 Jun 2016 14:39:52 +0000 (16:39 +0200)]
multipath-tools: replace FSF address with a www pointer

less prone to future modifications, new FSF licences point
exactly to this url: <http://www.gnu.org/licenses/>

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>
4 years agomultipath-tools: make uninstall leaves traces behind
Xose Vazquez Perez [Thu, 30 Jun 2016 13:42:16 +0000 (15:42 +0200)]
multipath-tools: make uninstall leaves traces behind

delete mpath_persist.h and libmpathpersist.so

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>
4 years agomultipath-tools: don't create /etc/init.d from make install
Xose Vazquez Perez [Thu, 30 Jun 2016 13:42:15 +0000 (15:42 +0200)]
multipath-tools: don't create /etc/init.d from make install

sysv scripts were deleted time ago.

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>
4 years agomultipath-tools: don't create /usr/share/doc/mpathpersist/ from make install
Xose Vazquez Perez [Thu, 30 Jun 2016 13:42:14 +0000 (15:42 +0200)]
multipath-tools: don't create /usr/share/doc/mpathpersist/ from make install

Useless, it's empty.

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>
4 years agomultipath-tools: merge RPM_OPT_FLAGS into OPTFLAGS
Xose Vazquez Perez [Thu, 30 Jun 2016 13:42:13 +0000 (15:42 +0200)]
multipath-tools: merge RPM_OPT_FLAGS into OPTFLAGS

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>
4 years agomultipath-tools: delete spec/rpm traces from Makefile
Xose Vazquez Perez [Thu, 30 Jun 2016 13:42:12 +0000 (15:42 +0200)]
multipath-tools: delete spec/rpm traces from Makefile

spec file was deleted time ago.

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>
4 years agomultipath-tools: new ONTAP maintainer
Xose Vazquez Perez [Thu, 23 Jun 2016 15:06:40 +0000 (17:06 +0200)]
multipath-tools: new ONTAP maintainer

Martin George is in charge of the ONTAP family.

Cc: Martin George <marting@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>
Acked-by: Martin George <marting@netapp.com>
4 years agolibmultipath: remove the DIRECTIO and TUR checker_name from hwtable
Christophe Varoqui [Fri, 8 Jul 2016 06:48:26 +0000 (08:48 +0200)]
libmultipath: remove the DIRECTIO and TUR checker_name from hwtable

so the corresponding devices inherit the new default TUR checker.

4 years agomultipath-tools: update path checker info in multipath.conf.5
Xose Vazquez Perez [Thu, 23 Jun 2016 13:42:18 +0000 (15:42 +0200)]
multipath-tools: update path checker info in multipath.conf.5

>From now on tur is by default, and warn about directio drawbacks.

Cc: Shyam Sundar <g.shyamsundar@yahoo.co.in>
Cc: Edward Goggin, EMC <egoggin@emc.com>
Cc: Matthias Rudolph <matthias.rudolph@hds.com>
Cc: Brian King, IBM <brking@linux.vnet.ibm.com>
Cc: Yacine Kheddache <yacine@alyseo.com>
Cc: Srinivasan Ramani <srinivas.ramani@oracle.com>
Cc: Bart Brooks, Pivot3 <bartb@pivot3.com>
Cc: Martin George <marting@netapp.com>
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>
4 years agomultipath-tools: change the default path checker from directio to tur
Xose Vazquez Perez [Thu, 23 Jun 2016 13:42:17 +0000 (15:42 +0200)]
multipath-tools: change the default path checker from directio to tur

change DEFAULT_CHECKER to TUR

Cc: Shyam Sundar <g.shyamsundar@yahoo.co.in>
Cc: Edward Goggin, EMC <egoggin@emc.com>
Cc: Matthias Rudolph <matthias.rudolph@hds.com>
Cc: Brian King, IBM <brking@linux.vnet.ibm.com>
Cc: Yacine Kheddache <yacine@alyseo.com>
Cc: Srinivasan Ramani <srinivas.ramani@oracle.com>
Cc: Bart Brooks, Pivot3 <bartb@pivot3.com>
Cc: Martin George <marting@netapp.com>
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>
4 years agomultipath-tools: minor edit in hwtable
Xose Vazquez Perez [Tue, 21 Jun 2016 00:36:04 +0000 (02:36 +0200)]
multipath-tools: minor edit in hwtable

delete empty lines and correct a NEC product.

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>
4 years agomultipath-tools: fix syntax in mpath_persistent_reserve_out.3
Xose Vazquez Perez [Tue, 21 Jun 2016 00:36:03 +0000 (02:36 +0200)]
multipath-tools: fix syntax in mpath_persistent_reserve_out.3

./libmpathpersist/mpath_persistent_reserve_out.3:91: warning: tab character in unquoted macro argument

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>
4 years agomultipath-tools: tips on adding new devices with proprietary handlers
Xose Vazquez Perez [Tue, 21 Jun 2016 00:36:02 +0000 (02:36 +0200)]
multipath-tools: tips on adding new devices with proprietary handlers

kernel(SCSI) and multipath-tools should be in sync.
Currently in drivers/scsi/scsi_dh.c:

 {"DGC", "RAID",                 "clariion" },
 {"DGC", "DISK",                 "clariion" },
 {"DGC", "VRAID",                "clariion" },

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

 {"IBM", "1722",                 "rdac", },
 {"IBM", "1724",                 "rdac", },
 {"IBM", "1726",                 "rdac", },
 {"IBM", "1742",                 "rdac", },
 {"IBM", "1745",                 "rdac", },
 {"IBM", "1746",                 "rdac", },
 {"IBM", "1813",                 "rdac", }, -> missing in multipath-tools !!!

Added in 4df01b. It's an IBM DCS3860.

 {"IBM", "1814",                 "rdac", },
 {"IBM", "1815",                 "rdac", },
 {"IBM", "1818",                 "rdac", },
 {"IBM", "3526",                 "rdac", },
 {"SGI", "TP9",                  "rdac", },
 {"SGI", "IS",                   "rdac", },
 {"STK", "OPENstorage D280",     "rdac", },
 {"STK", "FLEXLINE 380",         "rdac", },
 {"SUN", "CSM",                  "rdac", },
 {"SUN", "LCSM100",              "rdac", },
 {"SUN", "STK6580_6780",         "rdac", },
 {"SUN", "SUN_6180",             "rdac", },
 {"SUN", "ArrayStorage",         "rdac", }, -> missing in multipath-tools !!!

Added in 66195f. Unknown device, too generic name.

 {"DELL", "MD3",                 "rdac", },
 {"NETAPP", "INF-01-00",         "rdac", },
 {"LSI", "INF-01-00",            "rdac", },
 {"ENGENIO", "INF-01-00",        "rdac", },

Cc: Babu Moger <Babu.Moger@netapp.com>
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>
4 years agomultipath-tools: do not track temp vim files and patches
Xose Vazquez Perez [Tue, 21 Jun 2016 00:36:01 +0000 (02:36 +0200)]
multipath-tools: do not track temp vim files and patches

add *.swp and *.patch to .gitignore

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>
4 years agomultipath-tools: add DELL MD34xx/MD38xx
Xose Vazquez Perez [Tue, 21 Jun 2016 00:36:00 +0000 (02:36 +0200)]
multipath-tools: add DELL MD34xx/MD38xx

New MD34xx/MD38xx family based also on RDAC:
http://downloads.dell.com/manuals/common/md34xx_md38xx_support%20matrix2_en-us.pdf

MD3400   12 Gbps direct attached SAS storage array with 12 drives (3.5 inch)
MD3420   12 Gbps direct attached SAS storage array with 24 drives (2.5 inch)
MD3460   12 Gbps direct attached SAS storage dense array
MD3800i  10 Gbps iSCSI network storage array with 12 drives (3.5 inch)
MD3820i  10 Gbps iSCSI network storage array with 24 drives (2.5 inch)
MD3860i  10 Gbps iSCSI network storage dense array
MD3800f  16 Gbps FC network storage array with 12 drives (3.5 inch)
MD3820f  16 Gbps FC network storage array with 24 drives (2.5 inch)
MD3860f  16 Gbps FC network storage dense array

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>
4 years agomultipath-tools: unify DELL MD32xx and MD36xx
Xose Vazquez Perez [Tue, 21 Jun 2016 00:35:59 +0000 (02:35 +0200)]
multipath-tools: unify DELL MD32xx and MD36xx

They belong same family and share FW:
https://downloads.dell.com/manuals/common/md32xx_md36xx_supportmatrix2_en-us.pdf

The main differences are:
MD3200   6 Gbps direct attached SAS storage array with 12 drives (3.5 inch)
MD3220   6 Gbps direct attached SAS storage array with 24 drives (2.5 inch)
MD3260   6 Gbps direct Attached SAS storage dense array
MD3200i  1 Gbps iSCSI network storage array with 12 drives (3.5 inch)
MD3600i 10 Gbps iSCSI network storage array with 12 drives (3.5 inch)
MD3220i  1 Gbps iSCSI network storage array with 24 drives (2.5 inch)
MD3620i 10 Gbps iSCSI network storage array with 24 drives (2.5 inch)
MD3260i  1 Gbps iSCSI network storage dense array
MD3660i 10 Gbps iSCSI network storage dense array
MD3600f  8 Gbps fibre channel network storage array with 12 drives (3.5 inch)
MD3620f  8 Gbps fibre channel network storage array with 24 drives (2.5 inch)
MD3660f  8 Gbps fibre channel network storage dense array

A mandatory ACK from Hannes is required, as he was reluctant to unify them.

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>
4 years agomultipath-tools: reduce regex for DGC CLARiiON CX/AX and EMC VNX
Xose Vazquez Perez [Tue, 21 Jun 2016 00:35:58 +0000 (02:35 +0200)]
multipath-tools: reduce regex for DGC CLARiiON CX/AX and EMC VNX

vendor="DGC" and product=".*" is tooooo broad.
Using same product labels as in drivers/scsi/scsi_dh.c

Field-tested with Clariion VNX7500.

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>
4 years agomultipath-tools: remove spaces in S390 devices
Xose Vazquez Perez [Tue, 21 Jun 2016 00:35:57 +0000 (02:35 +0200)]
multipath-tools: remove spaces in S390 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>
4 years agomultipath-tools: add iSCSI product id for TEGILE ZEBI
Xose Vazquez Perez [Tue, 21 Jun 2016 00:35:56 +0000 (02:35 +0200)]
multipath-tools: add iSCSI product id for TEGILE ZEBI

Devices running 2.x firmware has a different product id for iSCSI.

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>
4 years agomultipath-tools: replace spaces with tabs in defaults.h
Xose Vazquez Perez [Sat, 11 Jun 2016 22:14:40 +0000 (00:14 +0200)]
multipath-tools: replace spaces with tabs in defaults.h

replace spaces by tabs in 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>
4 years agomultipath/main.c fix a minor typo
Milan P. Gandhi [Fri, 1 Jul 2016 11:17:02 +0000 (16:47 +0530)]
multipath/main.c fix a minor typo

Hello, Below patch fixes a minor typo in multipath/main.c

Thanks,
Milan.

Signed-off-by: Milan P. Gandhi <mgandhi@redhat.com>
4 years agolibmultipath: Allocate keywords directly
Hannes Reinecke [Tue, 14 Jun 2016 15:12:42 +0000 (17:12 +0200)]
libmultipath: Allocate keywords directly

There is no valid reason why we cannot allocate the keywords
structure within the configuration data directly.
So drop this weird pointer dance and use it directly.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agomultipathd: use userspace RCU to access configuration
Hannes Reinecke [Tue, 14 Jun 2016 14:36:30 +0000 (16:36 +0200)]
multipathd: use userspace RCU to access configuration

As the configuration is accessed from various threads at
various points in time any configuration change is tricky.
To avoid any race conditions this patch encapsulates any
configuration accesses via RCU, which will avoid any races
during reconfiguration.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agomultipath: make 'struct config' a local variable
Hannes Reinecke [Tue, 14 Jun 2016 12:56:09 +0000 (14:56 +0200)]
multipath: make 'struct config' a local variable

Instead of having a global 'struct config' we should be making
it a local variable. This enables us to track accesses and
will allow us a race-free configuration update.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agomultipathd: Fixup commandline argument handling
Hannes Reinecke [Wed, 15 Jun 2016 07:36:00 +0000 (09:36 +0200)]
multipathd: Fixup commandline argument handling

multipathd would attempt to store the commandline arguments in
an empty configuration, which would later be overwritten when
reading in the main configuration.
And it would not pass in the arguments correctly when using the
CLI interface.
So with this patch the commandline arguments are stored in
global variables, which then will always overwrite settings
from the configuration file.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: use (get,put)_multipath_config() accessors
Hannes Reinecke [Tue, 14 Jun 2016 11:44:49 +0000 (13:44 +0200)]
libmultipath: use (get,put)_multipath_config() accessors

Use (get,put)_multipath_config() accessors to mark accesses
to the configuration.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: use explicit 'config' argument for configuration file parsing
Hannes Reinecke [Tue, 14 Jun 2016 11:08:54 +0000 (13:08 +0200)]
libmultipath: use explicit 'config' argument for configuration file parsing

When parsing the configuration file we should be passing in
'struct config' as an explicit argument.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: use 'timeout' as argument for getprio()
Hannes Reinecke [Tue, 14 Jun 2016 10:21:20 +0000 (12:21 +0200)]
libmultipath: use 'timeout' as argument for getprio()

Pass in the 'checker_timeout' as explicit argument when calling
getprio().

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agoprio: use 'multipath_dir' as argument
Hannes Reinecke [Tue, 14 Jun 2016 09:59:56 +0000 (11:59 +0200)]
prio: use 'multipath_dir' as argument

Pass in the 'multipath_dir' config setting as explicit argument
for init_prio() and prio_get().

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agocheckers: use 'multipath_dir' as argument
Hannes Reinecke [Tue, 14 Jun 2016 09:59:56 +0000 (11:59 +0200)]
checkers: use 'multipath_dir' as argument

Pass in the 'multipath_dir' config setting as explicit argument
for init_checkers() and checker_get(). With this we can remove
references to struct config.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: use 'struct config' as argument for pathinfo()
Hannes Reinecke [Mon, 6 Jun 2016 13:30:53 +0000 (15:30 +0200)]
libmultipath: use 'struct config' as argument for pathinfo()

pathinfo() requires access to the entire configuration, not just
hwtable. So don't pretend this is the case.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agodiscovery: Pass in 'hwtable' for get_state() and scsi_sysfs_discovery()
Hannes Reinecke [Mon, 6 Jun 2016 12:57:11 +0000 (14:57 +0200)]
discovery: Pass in 'hwtable' for get_state() and scsi_sysfs_discovery()

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: use 'checkint' as argument for sysfs_set_scsi_tmo()
Hannes Reinecke [Mon, 6 Jun 2016 12:52:47 +0000 (14:52 +0200)]
libmultipath: use 'checkint' as argument for sysfs_set_scsi_tmo()

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: separate out 'udev' config entry
Hannes Reinecke [Mon, 6 Jun 2016 12:40:05 +0000 (14:40 +0200)]
libmultipath: separate out 'udev' config entry

Rather than add the 'udev' structure to the config entry we should
be using a separate global variable here. Otherwise we run into
a risk of udev getting out-of-sync internally when recreating
the udev structure.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agomultipath: make 'dev' internal to the multipath program
Hannes Reinecke [Mon, 6 Jun 2016 12:05:48 +0000 (14:05 +0200)]
multipath: make 'dev' internal to the multipath program

Only the multipath program is accessing the config entry 'dev',
so we should be making it a local variable.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agomultipath: make 'dev_type' internal to the multipath program
Hannes Reinecke [Mon, 6 Jun 2016 11:59:14 +0000 (13:59 +0200)]
multipath: make 'dev_type' internal to the multipath program

Only the multipath program uses the 'dev_type' config entry,
so we should be dropping it from the main configuration and
make it a local variable to the multipath program.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agomultipath: make 'cmd' internal to multipath program
Hannes Reinecke [Mon, 6 Jun 2016 11:54:03 +0000 (13:54 +0200)]
multipath: make 'cmd' internal to multipath program

Only the multipath program is using the 'cmd' setting, so we
should be dropping it from the config structure and make it
a local variable for multipath.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: fallback to checking environment variable in get_udev_uid()
Hannes Reinecke [Mon, 6 Jun 2016 11:48:16 +0000 (13:48 +0200)]
libmultipath: fallback to checking environment variable in get_udev_uid()

If we cannot get the udev attribute via udev we should always fallback
to checking the environment variable; there is no need to restrict
it to a specific command.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: add 'cmd' as argument for get_refwwid()
Hannes Reinecke [Mon, 6 Jun 2016 11:43:46 +0000 (13:43 +0200)]
libmultipath: add 'cmd' as argument for get_refwwid()

This patch adds an 'cmd' argument to get_refwwid(). This allows
store_pathvec() to be simplified and avoids accesses to conf->cmd.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: Do not access 'conf->cmd' in domap()
Hannes Reinecke [Mon, 6 Jun 2016 11:21:00 +0000 (13:21 +0200)]
libmultipath: Do not access 'conf->cmd' in domap()

'conf->cmd' is only ever set if we're called from multipath, so
we can combine the 'is_daemon' argument and the 'conf->cmd' check
in domap() and avoid accessing 'conf->cmd' in domap().

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: drop 'daemon' configuration setting
Hannes Reinecke [Mon, 6 Jun 2016 10:26:44 +0000 (12:26 +0200)]
libmultipath: drop 'daemon' configuration setting

There is no need anymore to access the 'daemon' configuration setting
as all callers export the 'is_daemon' argument, so it can be removed
from the config structure.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: use 'is_daemon' as argument for domap() etc
Hannes Reinecke [Mon, 6 Jun 2016 10:17:41 +0000 (12:17 +0200)]
libmultipath: use 'is_daemon' as argument for domap() etc

Use 'is_daemon' as argument for domap() and coalesce_paths()
to avoid having to access struct config.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agodmparser: use 'is_daemon' as argument for disassemble_map()
Hannes Reinecke [Mon, 6 Jun 2016 09:58:12 +0000 (11:58 +0200)]
dmparser: use 'is_daemon' as argument for disassemble_map()

Use 'is_daemon' as argument for disassemble_map() so that
dmparser.c doesn't need to access 'struct config' anymore.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agodevmapper: explicit config settings
Hannes Reinecke [Mon, 6 Jun 2016 09:52:42 +0000 (11:52 +0200)]
devmapper: explicit config settings

Rather than access 'conf' from within the code this patch moves
those settings to function arguments. So with this patch we don't
need to access 'struct config' anymore.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agoconfig: set 'deferred_remove' defaults at correct call
Hannes Reinecke [Mon, 6 Jun 2016 09:47:41 +0000 (11:47 +0200)]
config: set 'deferred_remove' defaults at correct call

We should be setting the defaults for 'deferred_remove' when
loading the configuration file, not when creating the hardware
entries.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agoUse 'mptable' as argument for find_mpe() and get_mpe_wwid()
Hannes Reinecke [Mon, 6 Jun 2016 09:41:39 +0000 (11:41 +0200)]
Use 'mptable' as argument for find_mpe() and get_mpe_wwid()

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agoRevert patch 'move filter_devnode() under vector lock'
Hannes Reinecke [Wed, 15 Jun 2016 07:02:13 +0000 (09:02 +0200)]
Revert patch 'move filter_devnode() under vector lock'

Patch was causing a segfault during booting and is being
replaced by the following series.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agomultipath-tools: fix up Apple controller family
Xose Vazquez Perez [Tue, 7 Jun 2016 17:54:23 +0000 (19:54 +0200)]
multipath-tools: fix up Apple controller family

Fix regex and delete space.

Cc: Shyam Sundar <g.shyamsundar@yahoo.co.in>
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>
4 years agoRemove duplicate Infinidat and Tegile hwtable entries
Christophe Varoqui [Mon, 20 Jun 2016 08:00:09 +0000 (10:00 +0200)]
Remove duplicate Infinidat and Tegile hwtable entries

4 years agoUpdate kpartx manpage with current output
Ritesh Raj Sarraf [Mon, 13 Jun 2016 08:40:47 +0000 (14:10 +0530)]
Update kpartx manpage with current output

See Debian Bug #796948 for details
Many users are reported to be consuming the output in a scripted setup

Signed-off-by: Ritesh Raj Sarraf <rrs@debian.org>
4 years agomultipath-tools: remove USER_FRIENDLY_NAMES_OFF
Xose Vazquez Perez [Fri, 17 Jun 2016 14:52:46 +0000 (16:52 +0200)]
multipath-tools: remove USER_FRIENDLY_NAMES_OFF

This is up to sysadmins, and it is already off by default.

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>
4 years agomultipath-tools: dm-devel list is only for subscribers
Xose Vazquez Perez [Fri, 17 Jun 2016 14:52:45 +0000 (16:52 +0200)]
multipath-tools: dm-devel list is only for subscribers

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>
4 years agomultipath-tools: group ONTAP family
Xose Vazquez Perez [Fri, 17 Jun 2016 14:52:48 +0000 (16:52 +0200)]
multipath-tools: group ONTAP family

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>
4 years agomultipath-tools: clean up comments at hwtable.c
Xose Vazquez Perez [Fri, 17 Jun 2016 14:52:47 +0000 (16:52 +0200)]
multipath-tools: clean up comments at hwtable.c

Remove redundant info and update company names.

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>
4 years agomultipath-tools: new email address for Srinivas Ramani
Xose Vazquez Perez [Fri, 17 Jun 2016 14:52:44 +0000 (16:52 +0200)]
multipath-tools: new email address for Srinivas Ramani

*This one needs a mandatory ACK from Srinivas Ramani*
Otherwise it must be removed.

Cc: Srinivas 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>
4 years agomultipath-tools: unreachable controllers maintainers
Xose Vazquez Perez [Fri, 17 Jun 2016 14:52:43 +0000 (16:52 +0200)]
multipath-tools: unreachable controllers maintainers

Delete 3 unreachable controllers maintainers, their emails are bounced.

Compellent Technologies, Inc.: Jim Lester <jim.lester@compellent.com>
NETAPP controller family: Dave Wysochanski <davidw@netapp.com>
IBM NSeries (NETAPP) controller family: Dave Wysochanski <davidw@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>
4 years agomultipath-tools: remove current maintainer from orphan array families.
Xose Vazquez Perez [Fri, 17 Jun 2016 14:52:42 +0000 (16:52 +0200)]
multipath-tools: remove current maintainer from orphan array families.

Redundant.

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>
4 years agomultipath-tools: add TEGILE devices to hardware table
Xose Vazquez Perez [Fri, 17 Jun 2016 14:52:41 +0000 (16:52 +0200)]
multipath-tools: add TEGILE devices to hardware table

based on documentation provided by manufacturer:
http://pages.tegile.com/rs/568-BVY-995/images/Oracle%20BPG%201.0.pdf

vendor                  "TEGILE"
product                 "ZEBI-FC|INTELLIFLASH"
hardware_handler        "1 alua"
path_selector           "round- robin 0"
path_grouping_policy    "group_by_prio"
no_path_retry           10
dev_loss_tmo            50
path_checker            tur
prio                    alua
failback                30
rr_min_io               128

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>
4 years agomultipath-tools: add INFINIDAT devices to hardware table
Xose Vazquez Perez [Fri, 17 Jun 2016 14:52:40 +0000 (16:52 +0200)]
multipath-tools: add INFINIDAT devices to hardware table

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

  vendor "NFINIDAT"             <----- This is not a bug, it's _NFINIDAT_
  product "InfiniBox.*"
  prio alua
  path_grouping_policy group_by_prio
  path_checker tur
  path_selector "round-robin 0"
  features "0"
  failback 30
  rr_weight priorities
  no_path_retry fail
  rr_min_io 1    # for kernels up to 2.6.31
  rr_min_io_rq 1 # for kernels 2.6.31 or newer
  flush_on_last_del yes
  fast_io_fail_tmo 5
  dev_loss_tmo 30

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>
4 years agomultipath-tools: add VIOLIN/CONCERTO ARRAY to hardware table
Xose Vazquez Perez [Fri, 17 Jun 2016 14:52:39 +0000 (16:52 +0200)]
multipath-tools: add VIOLIN/CONCERTO ARRAY to hardware table

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

- Red Hat Enterprise Linux 7.x for Violin 7300
vendor "VIOLIN"
product "CONCERTO ARRAY"
path_selector "round-robin 0"
path_grouping_policy multibus
prio alua
path_checker tur
rr_min_io 100
rr_weight priorities
failback immediate
features "1 queue_if_no_path"
no_path_retry 300

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>
4 years agoMerge branch 'coverity' of https://github.com/hreinecke/multipath-tools
Christophe Varoqui [Mon, 20 Jun 2016 06:44:01 +0000 (08:44 +0200)]
Merge branch 'coverity' of https://github.com/hreinecke/multipath-tools

4 years agomultipath-tools: add patchwork info to README
Xose Vazquez Perez [Wed, 15 Jun 2016 23:12:53 +0000 (01:12 +0200)]
multipath-tools: add patchwork info to README

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>
4 years agoMultipath: Remove duplicated memset() for multipathd show command.
Gris Ge [Wed, 15 Jun 2016 14:50:38 +0000 (22:50 +0800)]
Multipath: Remove duplicated memset() for multipathd show command.

Problem:

 * The duplicated memset() wasted too much time. For example:
   with 5k paths, "sudo multipathd -k'show paths'" command will have
   at least 5k times of memset().

Reasons:

 * The memory passing to snprint_xxx(e.g. snprint_multipath) is already
   zeroed by MALLOC().

 * No need to zero memory before snprintf which will always terminate
   the string with '\0'.

Signed-off-by: Gris Ge <fge@redhat.com>
4 years agomultipath-tools: delete trailing spaces and tabs
Xose Vazquez Perez [Tue, 14 Jun 2016 20:59:34 +0000 (22:59 +0200)]
multipath-tools: delete trailing spaces and tabs

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>
4 years agomultipath-tools: blacklist UX for RDAC arrays
Xose Vazquez Perez [Tue, 14 Jun 2016 20:59:35 +0000 (22:59 +0200)]
multipath-tools: blacklist UX for RDAC arrays

"Universal Xport" must be hidden for all RDAC arrays:
https://docs.oracle.com/cd/E19373-01/E24026/E24026-01.html
https://docs.oracle.com/cd/E19537-01/E24027/E24027-02.html

It was missing in: SUN STK6580_6780 and SUN_6180

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>
4 years agomultipath-tools: correct a syntax error in multipath.conf.5
Xose Vazquez Perez [Tue, 14 Jun 2016 17:52:50 +0000 (19:52 +0200)]
multipath-tools: correct a syntax error in multipath.conf.5

$ groff -z -b -wall ./multipath/multipath.conf.5
./multipath/multipath.conf.5:519: warning: macro `timeout' not defined (possibly missing space after `ti')

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>
4 years agomultipath-tools: change checker in RDAC devices with the native
Xose Vazquez Perez [Mon, 13 Jun 2016 17:02:20 +0000 (19:02 +0200)]
multipath-tools: change checker in RDAC devices with the native

Replace TUR checker with RDAC for:
"OPENstorage D280"
"STK6580_6780"

I don't know if it's a bug or feature, but for all other RDAC devices
"hwhandler" "checker" and "prio" are rdac.

*This patch needs an explicit ACK from Hannes and Christophe*

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>
4 years agomultipath-tools: add INFINIDAT devices to hardware table
Xose Vazquez Perez [Mon, 13 Jun 2016 22:46:56 +0000 (00:46 +0200)]
multipath-tools: add INFINIDAT devices to hardware table

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

  vendor "NFINIDAT"             <----- This is not a bug, it's _NFINIDAT_
  product "InfiniBox.*"
  prio alua
  path_grouping_policy group_by_prio
  path_checker tur
  path_selector "round-robin 0"
  features "0"
  failback 30
  rr_weight priorities
  no_path_retry fail
  rr_min_io 1    # for kernels up to 2.6.31
  rr_min_io_rq 1 # for kernels 2.6.31 or newer
  flush_on_last_del yes
  fast_io_fail_tmo 5
  dev_loss_tmo 30

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>
4 years agomultipath-tools: add TEGILE devices to hardware table
Xose Vazquez Perez [Mon, 13 Jun 2016 14:38:50 +0000 (16:38 +0200)]
multipath-tools: add TEGILE devices to hardware table

based on documentation provided by manufacturer:
http://pages.tegile.com/rs/568-BVY-995/images/Oracle%20BPG%201.0.pdf

vendor                  "TEGILE"
product                 "ZEBI-FC|INTELLIFLASH"
hardware_handler        "1 alua"
path_selector           "round- robin 0"
path_grouping_policy    "group_by_prio"
no_path_retry           10
dev_loss_tmo            50
path_checker            tur
prio                    alua
failback                30
rr_min_io               128

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>
4 years agomultipath-tools: housekeeping at prioritizers
Xose Vazquez Perez [Sat, 11 Jun 2016 22:14:41 +0000 (00:14 +0200)]
multipath-tools: housekeeping at prioritizers

add PRIO_IET to libmultipath/prio.h and sort them alphabetically.

"datacore" and "iet" are missing in multipath.conf.5 !!!

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>
4 years agolibmultipath/discovery.c: Fixup possible range overflow
Hannes Reinecke [Thu, 16 Jun 2016 07:09:00 +0000 (09:09 +0200)]
libmultipath/discovery.c: Fixup possible range overflow

When checking the maximum value for dev_loss_tmo we need to
use a larger type, otherwise the comparison will always be false.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath/devmapper.c: fixup possible buffer overflow
Hannes Reinecke [Thu, 16 Jun 2016 06:09:38 +0000 (08:09 +0200)]
libmultipath/devmapper.c: fixup possible buffer overflow

Fixup possible buffer overflow in dm_reassign_table().
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: add spin_lock in tur.c
Hannes Reinecke [Wed, 15 Jun 2016 11:37:45 +0000 (13:37 +0200)]
libmultipath: add spin_lock in tur.c

When failing to start the pthread we still should be taking
the spin lock; there might be other threads pending.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: Ignore errors from fcntl() in directio.c
Hannes Reinecke [Wed, 15 Jun 2016 11:58:30 +0000 (13:58 +0200)]
libmultipath: Ignore errors from fcntl() in directio.c

Mark the return value from fcntl() as unused to avoid compiler
warnings.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: mark return value from dup() as unused
Hannes Reinecke [Wed, 15 Jun 2016 10:17:41 +0000 (12:17 +0200)]
libmultipath: mark return value from dup() as unused

We are redirecting stderr, and can safely ignore any
errors from dup() here. So mark the return value as
unused.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agomultipathd: pid fd resource leak
Hannes Reinecke [Wed, 15 Jun 2016 09:10:17 +0000 (11:10 +0200)]
multipathd: pid fd resource leak

We open a PID filedescriptor, but never close them.
While this is not an error per se coverity complains here.
So be a good guy and close the PID fd properly.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agomultipathd: missing mpath_disconnect() in uxclnt()
Hannes Reinecke [Wed, 15 Jun 2016 09:16:05 +0000 (11:16 +0200)]
multipathd: missing mpath_disconnect() in uxclnt()

We should be calling mpath_disconnect() in uxclnt().
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath/sysfs.c: always terminate value from sysfs_attr_get_value()
Hannes Reinecke [Thu, 16 Jun 2016 09:02:41 +0000 (11:02 +0200)]
libmultipath/sysfs.c: always terminate value from sysfs_attr_get_value()

Coverity complained that the returned value is not always NULL
terminated.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agokpartx/lopart.c: use fstat() when reading device nodes
Hannes Reinecke [Thu, 16 Jun 2016 07:18:27 +0000 (09:18 +0200)]
kpartx/lopart.c: use fstat() when reading device nodes

Coverity pointed out that we shouldn't be using stat()/open(),
as the file might have vanished or changed in between those
two calls. So modify it to open()/fstat() instead.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agokpartx: use fstat() when reading sysfs attributes
Hannes Reinecke [Thu, 16 Jun 2016 06:03:54 +0000 (08:03 +0200)]
kpartx: use fstat() when reading sysfs attributes

Coverity pointed out that we shouldn't be using stat()/open(),
as the file might have vanished or changed in between those
two calls. So modify it to open()/fstat() instead.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agokpartx/devmapper.c: Remove unused 'next' argument
Hannes Reinecke [Wed, 15 Jun 2016 11:18:40 +0000 (13:18 +0200)]
kpartx/devmapper.c: Remove unused 'next' argument

Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agokpartx: Handle errors from lseek()
Hannes Reinecke [Wed, 15 Jun 2016 11:56:51 +0000 (13:56 +0200)]
kpartx: Handle errors from lseek()

Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agokpartx: do not use 'const' for mapname in get_hotplug_device()
Hannes Reinecke [Wed, 15 Jun 2016 09:51:23 +0000 (11:51 +0200)]
kpartx: do not use 'const' for mapname in get_hotplug_device()

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agokpartx: fixup filedescriptor leak in set_loop()
Hannes Reinecke [Wed, 15 Jun 2016 09:48:11 +0000 (11:48 +0200)]
kpartx: fixup filedescriptor leak in set_loop()

Upon error 'ffd' was never closed.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agokpartx: Memory leak in get_hotplug_device()
Hannes Reinecke [Wed, 15 Jun 2016 09:12:19 +0000 (11:12 +0200)]
kpartx: Memory leak in get_hotplug_device()

We allocate a string for 'device', but never free it on error.
And the string 'mapname' is never freed at all.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agokpartx: fixup fd leakage in lopart.c
Hannes Reinecke [Wed, 15 Jun 2016 08:50:00 +0000 (10:50 +0200)]
kpartx: fixup fd leakage in lopart.c

We're leaking filedescriptors when trying to figure out the loop
device.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: missing break in hds prioritizer
Hannes Reinecke [Wed, 15 Jun 2016 11:43:55 +0000 (13:43 +0200)]
libmultipath: missing break in hds prioritizer

Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmpathpersist: Handle send error
Hannes Reinecke [Thu, 16 Jun 2016 05:46:35 +0000 (07:46 +0200)]
libmpathpersist: Handle send error

Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmpathpersist: Pass sensebuffer as pointer
Hannes Reinecke [Wed, 15 Jun 2016 14:57:02 +0000 (16:57 +0200)]
libmpathpersist: Pass sensebuffer as pointer

It makes no sense to pass the entire sense buffer as a value,
we should rather pass the pointer to avoid exploding the stack.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmpathpersist: memory leak in mpath_persistent_reserve_(in,out)()
Hannes Reinecke [Wed, 15 Jun 2016 09:25:37 +0000 (11:25 +0200)]
libmpathpersist: memory leak in mpath_persistent_reserve_(in,out)()

When either curmp or pathvec couldn't be allocated we never
free up the other one, too.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmpathpersist: Fix possible overrun in devt2devname()
Hannes Reinecke [Wed, 15 Jun 2016 08:52:53 +0000 (10:52 +0200)]
libmpathpersist: Fix possible overrun in devt2devname()

pp->dev is of size FILE_NAME_SIZE, not PATH_SIZE.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmpathcmd: limit size of the CLI buffer
Hannes Reinecke [Wed, 15 Jun 2016 14:49:54 +0000 (16:49 +0200)]
libmpathcmd: limit size of the CLI buffer

A malicious program might inject a large buffer via the CLI and
causing the daemon to abort due to OOM.
So limit the maximum CLI buffer size to 64k.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: memory leak in iet.c
Hannes Reinecke [Wed, 15 Jun 2016 09:18:18 +0000 (11:18 +0200)]
libmultipath: memory leak in iet.c

'pmatch' was never freed.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: fixup possible buffer overflow in alua_rtpg.c
Hannes Reinecke [Thu, 16 Jun 2016 07:03:36 +0000 (09:03 +0200)]
libmultipath: fixup possible buffer overflow in alua_rtpg.c

We need to reserve an additional 4 bytes for the length of
the response buffer, so add a proper range check to avoid
accidental wrap-arounds.
Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: use fstat() when reading sysfs attributes
Hannes Reinecke [Thu, 16 Jun 2016 05:49:24 +0000 (07:49 +0200)]
libmultipath: use fstat() when reading sysfs attributes

Coverity pointed out that we shouldn't be using stat()/open(),
as the file might have vanished or changed in between those
two calls. So modify it to open()/fstat() instead.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath: drop unused variable 'diop' in libsg.c
Hannes Reinecke [Wed, 15 Jun 2016 12:20:01 +0000 (14:20 +0200)]
libmultipath: drop unused variable 'diop' in libsg.c

Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath/discovery.c: handle errors from sscanf()
Hannes Reinecke [Wed, 15 Jun 2016 12:07:11 +0000 (14:07 +0200)]
libmultipath/discovery.c: handle errors from sscanf()

Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>
4 years agolibmultipath/uevent.c: handle errors from setsockopt()
Hannes Reinecke [Wed, 15 Jun 2016 12:05:39 +0000 (14:05 +0200)]
libmultipath/uevent.c: handle errors from setsockopt()

Found by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.com>