multipath-tools/.git
6 years agoFix some socket issues
Benjamin Marzinski [Thu, 2 May 2013 21:46:28 +0000 (16:46 -0500)]
Fix some socket issues

multipath wasn't acutally using /org/kernel/linux/storage/multipathd
for its local socket because when it created and bound to that
socket, it didn't include the size of the structure in the length
it passed with the call.  The result was a trucnated name. Also,
mpathpersist wasn't updated to use the new socket name. This patch
fixes both.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agoFix hardware entry matching code
Benjamin Marzinski [Thu, 2 May 2013 21:46:27 +0000 (16:46 -0500)]
Fix hardware entry matching code

When a user defined hardware table entry's identifiers exactly
match a built-in one's, the built-in one is removed, and the list
is rescaned.  However, the built-in entry is not freed, and on the
rescan, the first user defined entry is treated as a built-in
entry. This patch frees the built-in entry, and decrements the
number of built-in entries, so that the rescan works as expected.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agoDon't print checker messages for ghost paths
Benjamin Marzinski [Thu, 2 May 2013 21:46:25 +0000 (16:46 -0500)]
Don't print checker messages for ghost paths

Since PATH_GHOST is not an unexpected state, we don't need to
keep printing out checker messages for these paths.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agoFix print_multipath_topology for large outputs
Benjamin Marzinski [Thu, 2 May 2013 21:46:24 +0000 (16:46 -0500)]
Fix print_multipath_topology for large outputs

print_multipath_topology had a hard size limit. With a large number
of LUNs and a large number of paths, it was possible to go over
this limit, and have some of the output cut off.
print_multipath_topology now checks for this, and resizes the
buffer if necessary.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agoMake kpartx correctly handle non-512 byte GPT
Benjamin Marzinski [Thu, 2 May 2013 21:46:23 +0000 (16:46 -0500)]
Make kpartx correctly handle non-512 byte GPT

The gpt code in kpartx correctly handled non-512 byte gpt
partitions right up until it was time to actually write out the
slice data. At that point it forgot to convert the logical block
address into a the proper slice offset. This patch fixes that.

Signed-off-by: Philipp Schmidt <philipp@ppc.in-berlin.de>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agoMake kpartx advise modprobe instead of insmod
Benjamin Marzinski [Thu, 2 May 2013 21:46:22 +0000 (16:46 -0500)]
Make kpartx advise modprobe instead of insmod

Users usually want to use modprobe instead of insmod, since it
handles finding the correct version and dependencies.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years ago[libmultipath] fix whitespace errors
Christophe Varoqui [Mon, 29 Apr 2013 20:45:03 +0000 (22:45 +0200)]
[libmultipath] fix whitespace errors

introduced by the 2 previous patches applied through git am.

6 years agoAdditional fixes for inconsistent quoting in snprint functions
Stewart, Sean [Tue, 23 Apr 2013 21:23:19 +0000 (21:23 +0000)]
Additional fixes for inconsistent quoting in snprint functions

This patch finishes the job from this commit: http://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=commitdiff;h=cef43b6f910f740c0e2d38761f58c5ebedfb7585;hp=41b85341ca514a50d18c592996a2ecb43a81fa90
All attributes printing strings from their snprint functions should now be quotes.

Signed-off-by: Sean Stewart <Sean.Stewart@netapp.com>
6 years agoFix failback parameter parsing in conf
Stewart, Sean [Tue, 23 Apr 2013 21:21:18 +0000 (21:21 +0000)]
Fix failback parameter parsing in conf

This patch fixes a problem introduced in this commit: http://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=commitdiff;h=cef43b6f910f740c0e2d38761f58c5ebedfb7585;hp=41b85341ca514a50d18c592996a2ecb43a81fa90
Currently, the string handler for failback on hw entries expects strings like "manual" to be quoted.  The buffer always strips quotes.
As a result, the keywords manual, immediate, and followover cannot be used to change a failback parameter through multipath.conf

Signed-off-by: Sean Stewart <Sean.Stewart@netapp.com>
6 years agoDocs: multipath.8: A little quick copyediting
Michael Witten [Tue, 23 Apr 2013 20:21:11 +0000 (20:21 +0000)]
Docs: multipath.8: A little quick copyediting

The following patch applies cleanly at least to the following commit:

  de4e708f82c5f5f1575fafefbceb3624600c3dac

To apply this patch, save this email to:

  /path/to/email

and then run the following from the repository:

  $ git am --scissors /path/to/email

8<-----------8<-----------8<-----------8<-----------8<-----------8<-----------

Date: Mon, 22 Apr 2013 21:31:36 +0000

The grammar was arguably incorrect (or at asymmetrical):

  multipath is used to detect... and coalesces them

Also, I found the description for the `device' parameter
to be a little rough.

Signed-off-by: Michael Witten <mfwitten@gmail.com>
6 years ago[libmultipath] Minimize noise with snapshots in emc_clariion checker
Jerome Levy [Sat, 27 Apr 2013 07:54:55 +0000 (09:54 +0200)]
[libmultipath] Minimize noise with snapshots in emc_clariion checker

Patch to stop emc_clariion_checker from logging messages when probes
to snapshot LUNs occur. Notification is still available if logging is
turned up (see condlog()) but normal probing of snapshots will no
longer produce status messages. Path functionality on snapshot probes
is unchanged.

Signed-off-by: Jerry Levy <jerome.levy@emc.com>
6 years agoDocs: multipath.conf.annotated: Document the `no_partitions' feature
Michael Witten [Thu, 25 Apr 2013 03:40:25 +0000 (03:40 +0000)]
Docs: multipath.conf.annotated: Document the `no_partitions' feature

The following commit added the `no_partitions' feature:

  095942eb14d735af80aa7d1d9fd8d3d53dc0db70
  Add 'no_partitions' feature
  Date: Wed Jul 23 14:15:12 2008 +0200

Signed-off-by: Michael Witten <mfwitten@gmail.com>
6 years agoDocs: multipath.conf.annotated: Update `path_selector' description
Michael Witten [Thu, 25 Apr 2013 03:18:53 +0000 (03:18 +0000)]
Docs: multipath.conf.annotated: Update `path_selector' description

In the following commit:

  c015b128103e7a6426d124a38cd679a181573b88
  multipath: change default path_selector to
  Date: Sat Jan 12 00:04:40 2013 -0600

the default for the `path_selector' attribute is changed
from "round-robin 0" to "service-time 0"; this new commit
reflects that change in `multipath.conf.annotated'.

Also, this commit adds documentation about the other
possible values for `path_selector'.

Signed-off-by: Michael Witten <mfwitten@gmail.com>
6 years agoDocs: multipath.conf.5: path_grouping_policy default is `failover', not `multibus'
Michael Witten [Thu, 25 Apr 2013 01:52:40 +0000 (01:52 +0000)]
Docs: multipath.conf.5: path_grouping_policy default is `failover', not `multibus'

$ git grep -n DEFAULT_PGPOLICY -- libmultipath/defaults.h
libmultipath/defaults.h:10:#define DEFAULT_PGPOLICY       FAILOVER

Signed-off-by: Michael Witten <mfwitten@gmail.com>
6 years agoDocs: multipath.conf.5: Typo: `occor' -> `occur'
Michael Witten [Wed, 24 Apr 2013 20:11:42 +0000 (20:11 +0000)]
Docs: multipath.conf.5: Typo: `occor' -> `occur'

Signed-off-by: Michael Witten <mfwitten@gmail.com>
6 years ago[PATCH] hwtable: Add vendor ID, and update defaults for NetApp
Sean Stewart [Tue, 2 Apr 2013 20:34:49 +0000 (22:34 +0200)]
[PATCH] hwtable: Add vendor ID, and update defaults for NetApp

This patch provides hwtable updates for NETAPP/LSI/ENGENIO E-Series
arrays, utilizing new features to detect TPGS support, automatically.

Signed-off-by: Sean Stewart <Sean.Stewart@netapp.com>
6 years agoFix rr_min_io_rq keyword name in multipath.conf.5
Leonardo Chiquitto [Fri, 22 Mar 2013 12:02:55 +0000 (13:02 +0100)]
Fix rr_min_io_rq keyword name in multipath.conf.5

Fix typo.

Signed-off-by: Leonardo Chiquitto <lchiquitto@suse.com>
Acked-by: Hannes Reinecke <hare@suse.de>
6 years agomultipath-tools: Adding major:minor to multipathd logging for device discovery and...
Chauhan, Vijay [Wed, 27 Feb 2013 14:05:21 +0000 (14:05 +0000)]
multipath-tools: Adding major:minor to multipathd logging for device discovery and removal

Path name, HCTL and major:minor (for ex: srp and mptsas) could change during subsequent
rediscovery of path and it becomes difficult to associate the paths with dm device using
default verbosity in the syslog (when there are large number of dm device configured).
multipathd logs few messages with path name and others with major:minor. We need to have
association between  major:minor and device name with default verbosity.

Signed-off-by: Vijay Chauhan <vijay.chauhan@netapp.com>
6 years agofix gzip path
glevand [Sun, 24 Feb 2013 15:42:13 +0000 (16:42 +0100)]
fix gzip path

Makefile.inc uses the absolute path /bin/gzip which isn't valid on all Linux
distros. E.g. on Arch Linux which i'm currently using the gzip tool is
installed in /usr/bin/gzip. The patch fixes the build problem on Linux distros
which do not have gzip in /bin directory.

6 years ago[kpartx] Add PS3 HDD partition table support
Phileas Fogg [Thu, 21 Feb 2013 21:10:18 +0000 (22:10 +0100)]
[kpartx] Add PS3 HDD partition table support

6 years agoHandle SCSI device states "quiesce" and "transport-offline" properly
Bart Van Assche [Thu, 14 Feb 2013 14:17:28 +0000 (15:17 +0100)]
Handle SCSI device states "quiesce" and "transport-offline" properly

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agomultipath: add HSV3[46]0 to multipath.conf.defaults
Xose Vazquez Perez [Tue, 22 Jan 2013 11:49:03 +0000 (12:49 +0100)]
multipath: add HSV3[46]0 to multipath.conf.defaults

Cc: Christophe Varoqui <christophe.varoqui@gmail.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: dm-devel@redhat.com
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
6 years agoAdd definitions for HP P6300
Hannes Reinecke [Thu, 28 Jun 2012 16:19:48 +0000 (18:19 +0200)]
Add definitions for HP P6300

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agokpartx: Deinstall kpartx_id
Hannes Reinecke [Thu, 17 Jan 2013 14:59:33 +0000 (15:59 +0100)]
kpartx: Deinstall kpartx_id

We've installed it, so we should be uninstalling it, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agomultipath: do not install rules file
Hannes Reinecke [Thu, 17 Jan 2013 14:59:32 +0000 (15:59 +0100)]
multipath: do not install rules file

multipathd now uses libudev, so the rules file is not required.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agomultipathd: call 'reconfigure' during startup
Hannes Reinecke [Thu, 17 Jan 2013 14:59:31 +0000 (15:59 +0100)]
multipathd: call 'reconfigure' during startup

The init script should be calling 'reconfigure' cli command
during startup. That not only checks if the daemon is running,
but will also cause a complete reconfiguration, so all devices
which might have been missed during init will be catched.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agomultipathd: log message when check interval has changed
Hannes Reinecke [Thu, 17 Jan 2013 14:59:30 +0000 (15:59 +0100)]
multipathd: log message when check interval has changed

We should only log the message if the check interval has
indeed changed.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agomultipathd: switch to abstract sockets for CLI commands
Hannes Reinecke [Thu, 17 Jan 2013 14:59:29 +0000 (15:59 +0100)]
multipathd: switch to abstract sockets for CLI commands

Instead of using file-based sockets we should be switching to
abstract sockets. Otherwise multipathd won't be able to start
if the directory is not available.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoBreak out loop in factorize_hwtable()
Hannes Reinecke [Thu, 17 Jan 2013 14:59:28 +0000 (15:59 +0100)]
Break out loop in factorize_hwtable()

We need to break out of the loop in factorize_hwtable() as
soon as we have removed a duplicate. Otherwise we might run
onto an deleted element in the outer loop.
Also we should declare factorize_hwtable() as 'void'
as it doesn't return anything.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agokpartx: Fix DASD name in kpartx_id
Hannes Reinecke [Thu, 17 Jan 2013 14:59:27 +0000 (15:59 +0100)]
kpartx: Fix DASD name in kpartx_id

The name of the DASD type is 'ccw', not 'dasd'.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoFix inconsistent entries after merging hwtable with user's config
Petr Uzel [Thu, 17 Jan 2013 14:59:26 +0000 (15:59 +0100)]
Fix inconsistent entries after merging hwtable with user's config

When merging the user provided configuration with the internal
hwtable entry in merge_hwe(), it can happen that the resulting
entry has a discrepancy between 'features' and 'no_path_retry'.
Check for this special case and fix it.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
6 years agokpartx_id: Generate persistent symlinks for 'wwn'
Hannes Reinecke [Thu, 17 Jan 2013 14:59:25 +0000 (15:59 +0100)]
kpartx_id: Generate persistent symlinks for 'wwn'

Newer udev versions generate /dev/disk/by-id/wwn-* symlinks.
We should be adjusting those for multipathing, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoProvide correct persistent symlinks for user_friendly_names
Hannes Reinecke [Thu, 17 Jan 2013 14:59:24 +0000 (15:59 +0100)]
Provide correct persistent symlinks for user_friendly_names

When the option 'user_friendly_names' is set we should provide
both symlinks, the persistent one and that one generated for
user_friendly_names.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoCleanup whitespaces
Hannes Reinecke [Thu, 17 Jan 2013 14:59:23 +0000 (15:59 +0100)]
Cleanup whitespaces

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agomultipath.conf.defaults update
Christophe Varoqui [Wed, 16 Jan 2013 21:02:27 +0000 (22:02 +0100)]
multipath.conf.defaults update

Add defaults for SUN STK6580, DataCore SANmelody and Intel
Multi-Flex

6 years agoRename variables in sysfs_get_tgt_nodename
Hannes Reinecke [Wed, 16 Jan 2013 12:14:16 +0000 (13:14 +0100)]
Rename variables in sysfs_get_tgt_nodename

For consistency.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoSet I_T_nexus_loss_timeout on SAS devices
Hannes Reinecke [Wed, 16 Jan 2013 12:14:15 +0000 (13:14 +0100)]
Set I_T_nexus_loss_timeout on SAS devices

Some SAS driver have an I_T_nexus_loss setting, which works
similar to the 'dev_loss_tmo' setting on FibreChannel.
So update it with the current values, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoSet recovery_tmo for iSCSI devices
Hannes Reinecke [Wed, 16 Jan 2013 12:14:14 +0000 (13:14 +0100)]
Set recovery_tmo for iSCSI devices

iSCSI has a 'recovery_tmo' value, which works similar to the
'fast_io_fail' mechanism on FibreChannel.
So we should be setting it from multipath, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoDiscover target ids for ATA
Hannes Reinecke [Wed, 16 Jan 2013 12:14:13 +0000 (13:14 +0100)]
Discover target ids for ATA

libata devices now have a separate sysfs entry, so we should be
discovering them properly, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoUse transport identifiers when detecting devices
Hannes Reinecke [Wed, 16 Jan 2013 12:14:12 +0000 (13:14 +0100)]
Use transport identifiers when detecting devices

This patch stores the transport identifiers, allowing
for a simplified dev_loss_tmo setting.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoRemove unused structures
Hannes Reinecke [Wed, 16 Jan 2013 12:14:11 +0000 (13:14 +0100)]
Remove unused structures

structs scsi_dev and scsi_idlun are unused.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoAdd SUN STK6580 to hardware table
Hannes Reinecke [Wed, 16 Jan 2013 12:14:10 +0000 (13:14 +0100)]
Add SUN STK6580 to hardware table

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoAdd Datacore SANSymphony to hwtable
Hannes Reinecke [Wed, 16 Jan 2013 12:14:09 +0000 (13:14 +0100)]
Add Datacore SANSymphony to hwtable

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoAdd hardware entry for Intel Multi-Flex
Hannes Reinecke [Wed, 16 Jan 2013 12:14:08 +0000 (13:14 +0100)]
Add hardware entry for Intel Multi-Flex

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoCorrect persistent symlink for cciss
Hannes Reinecke [Wed, 16 Jan 2013 12:14:07 +0000 (13:14 +0100)]
Correct persistent symlink for cciss

cciss devices have the prefix 'cciss', so we should generate the
correct one from kpartx_id, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agokpartx.rules: Check for accessible device-mapper device
Hannes Reinecke [Wed, 16 Jan 2013 12:14:06 +0000 (13:14 +0100)]
kpartx.rules: Check for accessible device-mapper device

We need to check for accessible device-mapper devices
right at the start, otherwise kpartx would be run on
inactive devices.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoCheck for !SUSPENDED in kpartx rules
Hannes Reinecke [Wed, 16 Jan 2013 12:14:05 +0000 (13:14 +0100)]
Check for !SUSPENDED in kpartx rules

Read-only devices appear as DM_STATE=READONLY, so we should
invert the check in kpartx rules to have kpartx run on
readonly devices, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoFixup .gitignore
Hannes Reinecke [Wed, 16 Jan 2013 12:14:04 +0000 (13:14 +0100)]
Fixup .gitignore

Only exclude the binaries, not the entire directories ...
And the nfs link, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoUpdate multipath.conf.defaults
Christophe Varoqui [Wed, 16 Jan 2013 20:40:22 +0000 (21:40 +0100)]
Update multipath.conf.defaults

the defaults.multipath_dir default value is set upon make, so
it may differ on different systems. Best discard it from the
multipath.conf.defaults.

Reported by Xose Vazquez Perez <xose.vazquez@gmail.com>

6 years agoRefresh the multipath.conf.defaults
Christophe Varoqui [Tue, 15 Jan 2013 20:57:27 +0000 (21:57 +0100)]
Refresh the multipath.conf.defaults

The command used to refresh multipath.conf.defaults on a system
with no /etc/multipath.conf installed is:

The explicative header must be added manually afterwards.

6 years agoFix some compilation -Wextra warnings
Christophe Varoqui [Mon, 14 Jan 2013 09:09:49 +0000 (10:09 +0100)]
Fix some compilation -Wextra warnings

Reported by Xose Vasquez Perez.
The dasd struct change was acked by Stefan Weinhuber.

6 years agoAdd missing log functions from Hannes tree
Christophe Varoqui [Sat, 12 Jan 2013 13:07:09 +0000 (14:07 +0100)]
Add missing log functions from Hannes tree

log_thread_flush()
log_reset()

6 years agoDrop useless link to curses library
Ritesh Raj Sarraf [Wed, 9 Jan 2013 10:05:56 +0000 (15:35 +0530)]
Drop useless link to curses library

Description: Do not link against ncurses unnecessarily
Author: Sven Joachim <svenjoac@gmx.de>
Bug-Debian: http://bugs.debian.org/646148
Last-Update: <2011-11-05>

Signed-off-by: Ritesh Raj Sarraf <rrs@debian.org>
6 years agoMinor spelling error fixes for Debian's lintian cleanliness
Ritesh Raj Sarraf [Wed, 9 Jan 2013 10:05:55 +0000 (15:35 +0530)]
Minor spelling error fixes for Debian's lintian cleanliness

fix missed-out hyphen

Signed-off-by: Ritesh Raj Sarraf <rrs@debian.org>
6 years agoexplicitly include posix_types.h
Guido Günther [Wed, 9 Jan 2013 10:05:54 +0000 (15:35 +0530)]
explicitly include posix_types.h

to get the correct type for __kernel_old_dev_t

Closes: #558990

Signed-off-by: Ritesh Raj Sarraf <rrs@debian.org>
6 years agomultipath: make path devices readonly again.
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:55 +0000 (00:04 -0600)]
multipath: make path devices readonly again.

Path device fds were changed to be opened read/write when the
mpathpersist code was added. However, I have talked with Vijay, and
this doesn't appear to be necessary for mpathpersist to work correctly.
If the path fds are opened read/write, when the are closed a change
uevent is triggered, which was causing problems during shutdown with
LVM on top of multipath devices. This patch reverts them to being read-only
again.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: Check blacklists as soon as possible
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:53 +0000 (00:04 -0600)]
multipath: Check blacklists as soon as possible

Multipath does a lot of unnecessary work on devices blacklisted by device
type or wwid before ignoring them.  When dealing with a large number of
devices blacklisted this way, multipath can take long time to complete.
The patch makes sure that multipath is checking the blacklists as soon
as it has the necessary information to do so. To do this, pathinfo() now
takes another flag DI_BLACKLIST, which is only used by store_pathinfo(),
that tells it to check if the device should be blacklisted. Doing this
cleanly also required changing how store_pathinfo() and rlookup_binding()
are called.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: check for NULL from udev_device_get_*
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:54 +0000 (00:04 -0600)]
multipath: check for NULL from udev_device_get_*

The udev_device_get_* functions can return NULL, an occassionally do
so in the multipathd code.  multipath needs to check if the result
is NULL before dereferencing it.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: Fix kpartx and udevd race
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:52 +0000 (00:04 -0600)]
multipath: Fix kpartx and udevd race

Sometimes when kpartx is used to view partition data on disk image files,
udev still has the loop device open when kpartx is trying to tear it down.
This causes the LOOP_CLR_FD ioctl to fail with EBUSY.  kpartx now retries
in this case.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: storagetek 6180 config
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:51 +0000 (00:04 -0600)]
multipath: storagetek 6180 config

New StorageTek default config.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: make reservation_key print out correctly
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:50 +0000 (00:04 -0600)]
multipath: make reservation_key print out correctly

This patch fixes the reservation_key print functions, so they print
it out like it was in the configuration file.  Also, it keeps
cli_getprstatus() from writing over random memory.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: make multipathd work with new dm/lvm
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:49 +0000 (00:04 -0600)]
multipath: make multipathd work with new dm/lvm

multipathd needs to get setup before lvm (lvm2-activation-early.service).
To do this, it needs to get started in sysinit.target like the other
dm services.

Signed-off-by: Peter Rajnoha <prajnoha@redhat.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: update documentation
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:48 +0000 (00:04 -0600)]
multipath: update documentation

Add some missing options to the documentation.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: rely on udev device creation for kpartx
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:47 +0000 (00:04 -0600)]
multipath: rely on udev device creation for kpartx

Since kpartx and multipathd don't wait on udev creating the device, there
was a race between libdevmapper and udev to create the device. This meant
that sometimes the /dev/mapper/ devices were devnodes, and sometimes they
were symlinks. Now, for multipathd and kpartx called without -s,
libdevmapper won't create the device nodes, so that udev will always be
responsible for it.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: fix set_oom_adj
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:46 +0000 (00:04 -0600)]
multipath: fix set_oom_adj

Fix set_oom_adj() to work correclty if OOM_ADJUST_MIN isn't
defined.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: update netapp config
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:45 +0000 (00:04 -0600)]
multipath: update netapp config

The netapp config now used the retain_attached_hwhandler and
detect_prio options to automatically configure correctly for both ALUA and
non-ALUA setups. They also requested that dev_loss_tmo be set to
the maximum for netapp devices.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: add detect_prio option to autodetect
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:44 +0000 (00:04 -0600)]
multipath: add detect_prio option to autodetect

This patch adds a new multipath.conf option, detect_prio.  If set to yes,
multipathd will try to determine the correct prioritizer for the device. If
it finds one, that will be used instead of its configured prioritizer.  If
none is found, the configured prioritizer will be used.  It can currently
only detect ALUA devices.

Also fixed and issue with select_prio where in the devices section, it was
passing in the prio name string instead of the prio args string to prio_get()

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: remove duplicates from multipath
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:43 +0000 (00:04 -0600)]
multipath: remove duplicates from multipath

Added code to remove duplcate entries in the devices section, and the
blacklist devices section of the builtin configuration table. The only
change to setup_default_blist is the addition of _blacklist_device()
to check if the device's bl_product entry already exists.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: add support for
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:42 +0000 (00:04 -0600)]
multipath: add support for

This adds support for the retain_attached_hw_handler. When this is set to
"yes", if the kernel has already attached a hardware handler to the multipath
path devices, multipath will use that one, instead of its configured one. If
no hardware handler is already attached, multipath use its configured one, if
any.  To properly ignore this on older kernels, I had to makes some changes
to the version checking code.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: make devt2devname use lstat to check
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:41 +0000 (00:04 -0600)]
multipath: make devt2devname use lstat to check

dm_reassign wasn't working correctly for me because devt2devname used stat()
to check if /sys/dev/block/major:minor was a symlink.  But stat() never returns
a symlink, if follows it. It needs to use lstat() instead.  Also, I made
multipath log a message when a dm device gets reassigned to use multipath.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: change default path_selector to
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:40 +0000 (00:04 -0600)]
multipath: change default path_selector to

My testing has showed service-time to be as good and occassionally
noticeably better than round-robin.  So the patch switches the
default selector to give better performance out of the box.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: remove default options from built-in
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:39 +0000 (00:04 -0600)]
multipath: remove default options from built-in

Since changing the path_selector, rr_min_io and rr_min_io_rq options
won't actually break the device configs, there's no reason to set
them equal to the defaults values.  They can just inherit them from
the defaults section.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agomultipath: default fast_io_fail to 5 seconds
Benjamin Marzinski [Sat, 12 Jan 2013 06:04:38 +0000 (00:04 -0600)]
multipath: default fast_io_fail to 5 seconds

This patch sets fast_io_fail to 5 seconds in the defaults section.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
6 years agoRevert "Display avg priority as group priority"
Christophe Varoqui [Wed, 9 Jan 2013 07:41:51 +0000 (08:41 +0100)]
Revert "Display avg priority as group priority"

This reverts commit 750db1f0dc08bf1d96ce64d32786dfe07b8ae3f9.

Do not compute pathgroup average priority twice on print.
Caught by Mike Christie.

6 years agoAdd missing structs.h include in the iet prioritizer
Christophe Varoqui [Wed, 9 Jan 2013 00:09:54 +0000 (01:09 +0100)]
Add missing structs.h include in the iet prioritizer

Patch fb11301c81c189954b704a9bfff951ba62c3c868 causes structs.h
to be included in checkers. The iet checker was forgotten.

6 years agomultipathd: lock vectors during initial configuration
Hannes Reinecke [Tue, 8 Jan 2013 13:54:19 +0000 (14:54 +0100)]
multipathd: lock vectors during initial configuration

During initial configuration the CLI thread is already running,
so we need to lock the vectors here to not race with the
'reconfigure' CLI command.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agomultipathd: crash in reconfigure CLI command
Hannes Reinecke [Tue, 8 Jan 2013 13:54:18 +0000 (14:54 +0100)]
multipathd: crash in reconfigure CLI command

The 'reconfigure' CLI command doesn't take the vector lock,
so if multipathd is processing a table / udev event at the
same time it'll crash.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agomultipathd: sighandlers might use uninitialized gvecs
Hannes Reinecke [Tue, 8 Jan 2013 13:54:17 +0000 (14:54 +0100)]
multipathd: sighandlers might use uninitialized gvecs

gvecs are initialized after signal handlers, which in turn
might access the vectors.
So the signal handlers might access uninitialized variables.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agomultipathd deadlocks during restart
Hannes Reinecke [Tue, 8 Jan 2013 13:54:16 +0000 (14:54 +0100)]
multipathd deadlocks during restart

During restart multipathd might deadlock as the uevent handler
is missing a cleanup handler. Thus the thread might be terminated
while it still holds the vector lock.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agomultipathd: Ignore errors when creating pidfile
Hannes Reinecke [Tue, 8 Jan 2013 13:54:15 +0000 (14:54 +0100)]
multipathd: Ignore errors when creating pidfile

We can use CLI commands to communicate with the daemon,
so we don't need the pidfile for correct operation.
Hence any errors from creating the pidfile can be safely
ignored.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoClarify dev_loss_tmo capping in multipath.conf.5
Hannes Reinecke [Tue, 8 Jan 2013 13:54:14 +0000 (14:54 +0100)]
Clarify dev_loss_tmo capping in multipath.conf.5

The linux kernel will not allow any dev_loss_tmo setting larger
than 300 if fast_io_fail is not set. So we should document this
in the manpage.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoRemove a conflict resolution left-over in multipath.conf.5
Christophe Varoqui [Tue, 8 Jan 2013 23:24:20 +0000 (00:24 +0100)]
Remove a conflict resolution left-over in multipath.conf.5

6 years agomultipath.conf.5: Clarify dev_loss_tmo settings
Hannes Reinecke [Tue, 8 Jan 2013 13:54:13 +0000 (14:54 +0100)]
multipath.conf.5: Clarify dev_loss_tmo settings

We need to document that dev_loss_tmo is in fact modified
by no_path_retry.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agomultipath.init.suse: Update usage message
Hannes Reinecke [Tue, 8 Jan 2013 13:54:12 +0000 (14:54 +0100)]
multipath.init.suse: Update usage message

The usage message in multipath.init.suse doesn't list 'reload'.
And 'reload' is a misnomer, as it's actually a restart.
So rename 'reload' to 'restart' and add to the usage message.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoSyntax error in /etc/init.d/boot.multipath
Hannes Reinecke [Tue, 8 Jan 2013 13:54:11 +0000 (14:54 +0100)]
Syntax error in /etc/init.d/boot.multipath

The multipath init script has a syntax error in line 113.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoMake 'allocated' an integer in vector.h
Hannes Reinecke [Tue, 8 Jan 2013 13:54:10 +0000 (14:54 +0100)]
Make 'allocated' an integer in vector.h

I don't trust the programmers here, as we're unconditionally
decreasing the 'allocated' setting on vector_free().
So better make that an integer to catch underflows.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoUse VECTOR_SIZE() defines
Hannes Reinecke [Tue, 8 Jan 2013 13:54:09 +0000 (14:54 +0100)]
Use VECTOR_SIZE() defines

The size of a vector slot might be larger than one, so we should
be using the VECTOR_SIZE() define everywhere.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoFix race condition in stop_waiter_thread()
Hannes Reinecke [Tue, 8 Jan 2013 13:54:08 +0000 (14:54 +0100)]
Fix race condition in stop_waiter_thread()

The signal handler might run before we had a chance to
set the 'waiter' context to '0', so better do it previously.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoDouble free in disassemble_map()
Hannes Reinecke [Tue, 8 Jan 2013 13:53:59 +0000 (14:53 +0100)]
Double free in disassemble_map()

Label 'out1' already frees 'word'; no need to do it here.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agolibmultipath: Print out uevent sequence number
Hannes Reinecke [Tue, 8 Jan 2013 13:54:07 +0000 (14:54 +0100)]
libmultipath: Print out uevent sequence number

For debugging we should be printing out the sequence number.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoClean up uevent queue on shutdown
Hannes Reinecke [Tue, 8 Jan 2013 13:54:06 +0000 (14:54 +0100)]
Clean up uevent queue on shutdown

During shutdown there might be some unprocessed events
in the queue. So clear them up.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoUpdate 'no_path_retry' correctly for failed paths
Hannes Reinecke [Tue, 8 Jan 2013 13:54:05 +0000 (14:54 +0100)]
Update 'no_path_retry' correctly for failed paths

The bug is triggered if path failed event is received by multipathd after all
paths have been already marked as failed. Surprisingly enough, it seems to
happen quite often; colleague of mine who tested this hit this bug every time.

Here is event sequence that explains this bug. I left some messages for
clarity; full log is available on request. We have completed initialization and
set feature queue_if_no_path for map CX_201 by virtue of using no_path_retry >
0.

Aug 31 10:49:09 | CX_201: devmap event #18
Aug 31 10:49:09 | CX_201: discover
Aug 31 10:49:09 | CX_201: rr_weight = 1 (internal default)
Aug 31 10:49:09 | CX_201: pgfailback = -2 (controller setting)
Aug 31 10:49:09 | CX_201: no_path_retry = 2 (controller setting)
Aug 31 10:49:09 | pg_timeout = NONE (internal default)
Aug 31 10:49:09 | 65:192: mark as failed
Aug 31 10:49:09 | CX_201: remaining active paths: 3
Aug 31 10:49:09 | 8:192: mark as failed
Aug 31 10:49:09 | CX_201: remaining active paths: 2
Aug 31 10:49:09 | CX_201: devmap event #19
Aug 31 10:49:09 | CX_201: discover
Aug 31 10:49:09 | CX_201: rr_weight = 1 (internal default)
Aug 31 10:49:09 | CX_201: pgfailback = -2 (controller setting)
Aug 31 10:49:09 | CX_201: no_path_retry = 2 (controller setting)
Aug 31 10:49:09 | pg_timeout = NONE (internal default)

Two paths failed by driver, multipahd marked them as failed.

Aug 31 10:49:09 | checker failed path 66:0 in map CX_201
Aug 31 10:49:09 | CX_201: remaining active paths: 1

Checker failed third path

Aug 31 10:49:09 | checker failed path 8:96 in map CX_201
Aug 31 10:49:09 | CX_201: Entering recovery mode: max_retries=2
Aug 31 10:49:09 | CX_201: remaining active paths: 0

Checker failed last path; multipathd entered retry loop.

Aug 31 10:49:10 | CX_201: devmap event #20

We got late event about failed path

Aug 31 10:49:10 | CX_201: discover

Start discovery. Call update_multipath -> setup_multipath ->
update_multipath_strings -> update_multipath_tablle -> disassemble_map.

Now disassemble_map tries to set no_path_retry value from kernel. This
obviously is not going to work as kernel is able remembering only Boolean
(queue/fail), while no_path_retry is arbitrary integer. So no_path_retry is set
to NO_PATH_RETRY_QUEUE from kernel.

Aug 31 10:49:10 | CX_201: rr_weight = 1 (internal default)
Aug 31 10:49:10 | CX_201: pgfailback = -2 (controller setting)

At this point we call set_no_path_retry:

set_no_path_retry(struct multipath *mpp)
{
        mpp->retry_tick = 0;
        mpp->nr_active = pathcount(mpp, PATH_UP) + pathcount(mpp, PATH_GHOST);
        if (mpp->nr_active > 0)
                select_no_path_retry(mpp);

So

1) retry_tick is reset
2) nr_active = 0 (no active path)
3) we do not set no_path_retry from config file because nr_active == 0 => left
with NO_PATH_RETRY_QUEUE.

Aug 31 10:49:10 | pg_timeout = NONE (internal default)

>From now on there is no state changes, so map is hung forever.

Signed-off-by: Martin Wilck <martin.wilck@ts.fujitsu.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoPrint log messages when updating tables failed
Hannes Reinecke [Tue, 8 Jan 2013 13:54:04 +0000 (14:54 +0100)]
Print log messages when updating tables failed

Add some logging messages to identify the case of failure.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoMake log_pthread more robust
Hannes Reinecke [Tue, 8 Jan 2013 13:54:03 +0000 (14:54 +0100)]
Make log_pthread more robust

We don't need to allocate memory for mutexes, we can just
be using static variables. And valgrind complained about
logqueue flush from shutdown, so don't do this.
The normal shutdown process should be flushing the log
queue anyway.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoDo not call sysfs_get_timeout for non-SCSI devices
Hannes Reinecke [Tue, 8 Jan 2013 13:54:02 +0000 (14:54 +0100)]
Do not call sysfs_get_timeout for non-SCSI devices

Only SCSI devices have a timeout, so there is no point in
trying to set a timeout for other types.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoPath checker should return PATH_DOWN when no path is found
Hannes Reinecke [Tue, 8 Jan 2013 13:54:01 +0000 (14:54 +0100)]
Path checker should return PATH_DOWN when no path is found

If the path checker fails to lookup the path in sysfs it's
already gone, so we should rather return 'PATH_DOWN' here.
Otherwise the path will never marked failed and no failover
will happen.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agolibmultipath: prio keyword ignored for multipath config
Hannes Reinecke [Tue, 8 Jan 2013 13:54:00 +0000 (14:54 +0100)]
libmultipath: prio keyword ignored for multipath config

When specifying the 'prio' keyword in the multipath section
of the configuration file the value is ignored.
Problem is that the 'wwid' value is set only after the call
to select_prio(), so the correct definition couldn't been
found in the config file.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoSwitch off 'queue_if_no_path' before removing maps
Hannes Reinecke [Tue, 8 Jan 2013 13:53:58 +0000 (14:53 +0100)]
Switch off 'queue_if_no_path' before removing maps

Before we try to flush a map we have to switch off the
'queue_if_no_path' setting to flush any outstanding I/O.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoInconsistent string quoting
Hannes Reinecke [Tue, 8 Jan 2013 13:53:57 +0000 (14:53 +0100)]
Inconsistent string quoting

When printing the hardware table strings are quoted twice, and
even numerical values have single quotes. This patch removes
the double quotes and retains single quotes only for string
values.

Signed-off-by: Hannes Reinecke <hare@suse.de>
6 years agoCheck return code from pathinfo()
Hannes Reinecke [Tue, 8 Jan 2013 13:53:56 +0000 (14:53 +0100)]
Check return code from pathinfo()

Pathinfo might fail, which indicates that the path is not
available anymore. So check the return value and take
appropriate action.

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