Hannes Reinecke [Fri, 26 Sep 2008 13:31:07 +0000 (15:31 +0200)]
multipath: Check return value for get_inq()
Check the return value of get_inq() to correctly handle devices
with unconnected LUNs.
References: 419123
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 23 Jul 2008 10:11:08 +0000 (12:11 +0200)]
Further whitespace cleanup
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 23 Jul 2008 10:04:40 +0000 (12:04 +0200)]
Increase RDAC priority values
A priority value of '0' will cause a path to never be selected,
so we should make sure to return always a non-zero value for
available paths.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 23 Jul 2008 09:20:53 +0000 (11:20 +0200)]
Valgrind fixes
Valgrind found some issues. And clear up whitespaces while we're at it.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Christophe Varoqui [Sun, 19 Apr 2009 22:44:38 +0000 (00:44 +0200)]
[lib] set PASSCRED netlink socket option
Christophe Varoqui [Sun, 19 Apr 2009 22:16:58 +0000 (00:16 +0200)]
[lib] check udev and netlink messages sender uid
Ignore if not 0.
This change was suggested by Kay Sievers. It required switching from
recv() to recvmsg().
Mike Snitzer [Fri, 17 Apr 2009 22:07:58 +0000 (18:07 -0400)]
multipath-tools: install libmultipath.so in $syslibdir
Allows libmultipath.so to be installed in the proper lib dir
(e.g. /lib64). $libdir is already used for /lib/multipath
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Mike Snitzer [Fri, 17 Apr 2009 22:07:59 +0000 (18:07 -0400)]
multipath-tools: update multipathd.init.redhat
Various small improvements to Red Hat's multipathd initscript.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Mike Snitzer [Fri, 17 Apr 2009 22:07:57 +0000 (18:07 -0400)]
multipath-tools: update scsi_id arguments
Switch over to using --whitelisted and --device
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Christophe Varoqui [Sun, 19 Apr 2009 21:44:28 +0000 (23:44 +0200)]
[lib] define _GNU_SOURCE in preparation for using recvmsg()
And deal with consequences :
1/ rename util::basename() to util::basenamecpy() to resolve
namespace conflict GNU version
2/ don't redefine _GNU_SOURCE if already set in regex.c to avoid
a build warning
Christophe Varoqui [Wed, 15 Apr 2009 19:47:01 +0000 (21:47 +0200)]
[lib] more selective mask to catch uevent from netlink
Kay Sievers reports 0x01 is the only group used by the kernel.
As udev will start using other groups, pollution will result from
our lack of filtering.
Christophe Varoqui [Fri, 3 Apr 2009 22:33:25 +0000 (00:33 +0200)]
[lib] bump version to 0.4.9 in preparation for release
Christophe Varoqui [Fri, 3 Apr 2009 22:29:49 +0000 (00:29 +0200)]
[multipathd] actually propose restorequeuing et disablequeuing in CLI
this bit was missing from the forward-port
Benjamin Marzinski [Fri, 3 Apr 2009 22:09:55 +0000 (00:09 +0200)]
[multipathd] Add options to multipathd to turn off queueing
Even when the last path of a multipath device is deleted, it can't be
removed until all the queued IO is flushed. For devices that have
no_path_retry set to queue, this doesn't automatically happen.
This patch adds a "flush_on_last_del" config file option, that causes the
multipath device to automatically turn off queueing when the last path is
deleted. It also adds the "disablequeueing" and "restorequeueing"
multipathd cli commands.
Benjamin Marzinski [Fri, 13 Mar 2009 20:55:14 +0000 (15:55 -0500)]
set pthread stack size to at least PTHREAD_STACK_MIN
Setting the stacksize too small just causes
pthread_attr_setstacksize() to fail, leaving you with the default stack
size. On some architectures, the default stacksize is large, like 10Mb.
Since you start one waiter thread per multipath device, every 100
devices eats up 1Gb of memory.
The other problem is that when I actually read the pthread_attr_init man
page (it can fail. who knew?), I saw that it can fail with ENOMEM. Also,
that it had a function to free it, and that the result of reinitializing
an attr that hadn't been freed was undefined. Clearly, this function
wasn't intended to be called over and over without ever freeing the
attr, which is how we've been using it in multipathd. So, in the spirit
of writing code to the interface, instead of to how it appears to be
currently implemented, how about this.
Benjamin Marzinski [Thu, 12 Mar 2009 18:38:11 +0000 (13:38 -0500)]
remove deleted path from pathvec
When the last path in a multipath map was removed, the path wasn't getting
deleted from the pathvec before it was getting freed.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Fri, 3 Apr 2009 04:19:36 +0000 (23:19 -0500)]
Clean up multipath linking
This is a patch to fix up the linking. It does two things. First, it makes
libmultipath.so install to /lib/ just like a normal shared library, so you
don't have to use -rpath to link to it. Second, and more importantly,
it moves the libaio linking into libcheckdirectio.so, where it belongs. Since
libcheckdirectio.so is a dynamic shared object, multipath and multipathd don't
know what functions they need to link in from libaio. This fixes the directio
lockup for me.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Fri, 3 Apr 2009 04:44:19 +0000 (23:44 -0500)]
Miscellaneous multipath bugfixes
This is mostly a cleanup of some bugs that recently got introduced. In
ACT_RESIZE we were trying to create a read-only device before we tried
to create a read/write one (I also added the ability to fail back to
read-only in ACT_RELOAD). There were some printouts that I assume were
for debugging, and some duplicate code. And I switched it so that
dm_simplecmd_flush did flushing, and dm_simplecmd_noflush didn't.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Christophe Varoqui [Thu, 2 Apr 2009 21:23:12 +0000 (23:23 +0200)]
[multipathd] minor logging fix for the resize handler
add missing format param
Christophe Varoqui [Thu, 2 Apr 2009 21:17:29 +0000 (23:17 +0200)]
[lib] use explicit names dm_simplecmd_{flush,noflush}
easier than the magic value used in static dm_simple_cmd to drive
the flush/noflush behaviour
Konrad Rzeszutek [Thu, 2 Apr 2009 21:04:17 +0000 (23:04 +0200)]
Support resizing of multipath maps.
This is patch that initially showed up on dm-devel mailing list:
http://www.linux-archive.org/device-mapper-development/162594-multipath-tools-libmultipath-configure-c-libmu.html
which was posted on dm-devel mailing list, but never ported
over to work with the git version. This forward-port by me
works.
Benjamin Marzinski [Thu, 2 Apr 2009 20:36:41 +0000 (22:36 +0200)]
[multipathd] signal deadlock
If multipathd is run with -v3, both the SIGHUP, and the SIGUSR1 signal handlers
will log a message. If a multipathd thread receives one of these signals while
it has a log lock held, it deadlocks itself. Also, the SIGHUP handler will grab
the vecs lock, so if any thread receives a SIGHUP while holding the vecs lock,
it deadlocks itself. This commit blocks the appropriate signals to guard
against this.
Hannes Reinecke [Wed, 1 Apr 2009 20:31:01 +0000 (22:31 +0200)]
[multipathd] /var/run/multipathd.sock is world-writable
Due to an stray 'umask()' the socket file is in fact world-writable,
allowing for an easy exploit.
References: 458598
Hannes Reinecke [Fri, 27 Mar 2009 22:50:18 +0000 (23:50 +0100)]
Stack overflow in uev_trigger()
uev_discard uses sscanf to write a 10 byte string into an array,
but I forgot to take the trailing NULL byte into account.
Konrad Rzeszutek [Tue, 24 Mar 2009 18:14:37 +0000 (19:14 +0100)]
Don't display the state of the newly added map during addition in the daemon
and don't switch groups.
A previous commit mass-changed #ifdef DAEMON to check for 'mpp->waiter'.
Unfortunatly when the 'domap' function is called with ACT_CREATE in the daemon,
the mpp->waiter is not set, hence the multipath client mode logic is choosen.
Fixing this triggers another issues which is that newly added path via
ACT_CREATE won't have their waitevent thread created as the caller checks
mpp->action (which changed to ACT_NOTHING) and won't start the thread.
Konrad Rzeszutek [Tue, 24 Mar 2009 18:04:31 +0000 (19:04 +0100)]
Free prio_name and checker_name now that we dynamically allocate them.
In earlier releases the prio_name and checker_name would point
to statically allocated values. Now that we strdup them, we need
to free them during shutdown.
Konrad Rzeszutek [Tue, 24 Mar 2009 18:01:05 +0000 (19:01 +0100)]
Unload prio and checkers libraries during shutdown.
Our statup sequence is 'load_config', 'init_checkers', and 'init_prio'.
Both init_* functions reset the list of prio and checkers, which is
unfortunate as in load_config, depending on the multipat.conf, would
load prio and checker libraries. This results in double-loading of
the libraries and a memory leak.
Konrad Rzeszutek [Tue, 24 Mar 2009 17:49:14 +0000 (18:49 +0100)]
Race-condition fix with free_waiter threads during shutdown.
When we shutdown, the main process locks the mutex, causing
all of the free_waiter functions to pile up on their lock.
Once we unlock in the main process, all of the free_waiters
start working. However the next instruction in the main proces
is to destroy the mutex. The short window is all the free_waiter
threads have to do their cleanup before they attempt to unlock
the mutex - which might have been de-allocated (and set to NULL).
End result can be a seg-fault.
This fix adds a ref-count to the mutex so that during shutdown
we spin and wait until all of the free_waiter functions
have completed and the ref-count is set to zero.
Konrad Rzeszutek [Tue, 24 Mar 2009 17:22:06 +0000 (18:22 +0100)]
[checkers] update doc for path checkers and use MALLOC instead of malloc
The internal memory debugger throws a fit if the path checkers are
using the malloc instead of the 'MALLOC' macro.
Konrad Rzeszutek [Tue, 24 Mar 2009 17:16:48 +0000 (18:16 +0100)]
[checkers] Allocate only once the EMC-clariion global checker's stage area
The multi-path global context on every path checker init would be
set. In scenarios where you have four paths per multipath, that context
would be set four times instead of once causing a small memory leak
(4 bytes per block disk).
Babu Moger [Sat, 7 Mar 2009 14:49:10 +0000 (15:49 +0100)]
[lib] add LSI hardware settings to internal defaults
This patch adds the hwtable for LSI rdac generic storage. Also sets the feature pg_init_retries to maximum(50).
Benjamin Marzinski [Sun, 18 Jan 2009 22:44:51 +0000 (23:44 +0100)]
[lib] plug fd leak in callout error path and and error messages
multipathd was not releasing fds when a fork failed in execute_program.
Also, the error messages from execute_program were not very
helpful. This patch fixes both
Christophe Varoqui [Wed, 17 Dec 2008 23:13:30 +0000 (00:13 +0100)]
[lib] dm_flush_map on a non-multipath devmap do nothing and returns 0
So that "multipath -F" can succeed when non-multipath maps are active
on the system.
Christophe Varoqui [Wed, 17 Dec 2008 23:01:37 +0000 (00:01 +0100)]
[lib] don't add up errors in dm_flush_maps()
to avoid return code overflow, as pointed by "Bryn M. Reeves",
Redhat.
Christophe Varoqui [Wed, 17 Dec 2008 22:39:47 +0000 (23:39 +0100)]
[multipathd] log the uevent discarding as debug information
Konrad Rzeszutek [Wed, 17 Dec 2008 22:24:40 +0000 (23:24 +0100)]
[lib] Memory leak when deleting and re-adding device-mapper entries.
If we remove a map (with configuration details specified in the multipath.conf file)
and later re-add it, the pointer to the config is over-written without first
de-allocating the values.
Konrad Rzeszutek [Wed, 17 Dec 2008 22:23:09 +0000 (23:23 +0100)]
[multipathd] Memory leak in ev_add_map.
When using dm_mapname it makes a strdup of the returned value. We use
the dm_mapname return value (alias) in our function but neglected
to free it at the exit points.
Konrad Rzeszutek [Wed, 17 Dec 2008 22:22:01 +0000 (23:22 +0100)]
[lib] The internal debug memory leak printout has output jumbled.
When using the internal memory leak the function that call realloc get a
confused output. The fix puts the list of operation in the right
order.
Konrad Rzeszutek [Wed, 17 Dec 2008 22:20:44 +0000 (23:20 +0100)]
[lib] Need to use FREE macro instead of free.
When using the internal memory leak checker it is imperative that
all free use the FREE macro. Otherwise accounting errors show up.
Konrad Rzeszutek [Wed, 17 Dec 2008 22:19:19 +0000 (23:19 +0100)]
[lib] Substantial memory leak when large amount of LUNs are present
dm_get_name() was creating a vector, populating it with multipaths,
then only deleting the vector itself, which leaked all of the multipaths.
If the number of LUNs (ie. multipaths) was large then the leak was equally large.
Signed-off-by: Konrad Rzeszutek <konrad@virtualiron.com>
Benjamin Marzinski [Thu, 11 Dec 2008 22:12:40 +0000 (16:12 -0600)]
Fix user_friendly_names for WWIDs with spaces
The user_friendly_names code didn't handle WWIDs with spaces correctly. This
fixes it by taking everything from the start of the WWID to the end of the line
as the WWID. The only downside is that if someone hand edits their bindings
file, they may leave stray whitespace at the end of the line, and cause it to
not match. This could ne solved by quoting the WWIDs and escaping any quotes
that they might have, but I don't think that people hand edit their bindings
files enough to make it a problem.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Thu, 11 Dec 2008 22:11:40 +0000 (16:11 -0600)]
Fix broken major:minor device handling
devt2devname was not actually setting devname, so multipath was not able to
do operate on devices using major:minor
This patch sets devname, and also checks for an unlikely buffer overrun.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Thu, 11 Dec 2008 22:10:27 +0000 (16:10 -0600)]
Fix for parsing multipath.conf files without spaces before brackets
There's a bug in bug in the multipath.conf code that keeps multipath from
correctly parsing config files where there is no space between a section name
and the opening bracket. For instance
devices {
device {
...
}
}
works but
devices {
device{
...
}
}
doesn't. This patch makes sure that brackets are the recognized as seperate from
the token that they follow, unless they are part of a quoted string.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Thu, 11 Dec 2008 22:07:25 +0000 (16:07 -0600)]
config file cleanup and a defaults file
This patch cleans up multipath.conf.annotated and multipath.conf.synthetic adds
a multipath.conf.defaults file that lists the builtin default configs.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Thu, 11 Dec 2008 22:06:07 +0000 (16:06 -0600)]
Fix for kpartx on sparc64
This typedef change is necessary to make kpartx work on sparc64 machines.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Thu, 11 Dec 2008 22:03:28 +0000 (16:03 -0600)]
Fix for uevent devpath handling
This is necessary to make uevents work on fedora, since devpath appears as
something like:
'/devices/pci0000:00/0000:00:0a.0/0000:06:00.0/host11/rport-11:0-1/target11:0:1/11:0:1:0/block/sdi'
It simply strips off the everything up to the /block.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Christophe Varoqui [Sun, 30 Nov 2008 23:35:42 +0000 (00:35 +0100)]
[doc] path_checker can't be set in a multipath {} config block
All docs wrongly stated that as valid. It is not, mainly
because path checker selection happens before assigning the
path to a multipath.
Thanks to Matthew Kent for pointing this out.
Christophe Varoqui [Sun, 30 Nov 2008 22:56:46 +0000 (23:56 +0100)]
[lib] add '%c' wildcard to display path checker type in cli
$ sudo multipathd show paths format "%d %i %c"
dev hcil checker
sdb 5:0:0:0 readsector0
sdc 5:0:0:1 readsector0
Matthew Kent [Sun, 30 Nov 2008 22:55:10 +0000 (23:55 +0100)]
[build] rpm specfile fix
catch up with recent file movement.
Christophe Varoqui [Mon, 24 Nov 2008 22:14:59 +0000 (23:14 +0100)]
[multipath] set "multipath -f|-F" return code correctly
Thanks to Diedrich Ehlerding <diedrich.ehlerding@fujitsu-siemens.com>
for reporting this.
Christophe Varoqui [Thu, 20 Nov 2008 22:16:01 +0000 (23:16 +0100)]
strip ANSI color markers in non-interactive mode
Tested with piped and redirected stdout, using either "multipath -l"
or "multipathd show topo". Seems there are no more blatant regression.
Let me know if there are, because I'm tempted to go a little further
with those ANSI codes by highlighting degrated/failure situation.
Christophe Varoqui [Wed, 19 Nov 2008 23:41:45 +0000 (00:41 +0100)]
[multipathd] easier multipathd interaction method
Previously using the CLI commands from the shell was done using :
multipathd -k"show paths format \"%w %d %i %s %t %T %D\""
Now you can also use :
multipathd -- show paths format "%w %d %i %s %t %T %D"
or
multipathd show paths format "%w %d %i %s %t %T %D"
Christophe Varoqui [Wed, 19 Nov 2008 22:26:59 +0000 (23:26 +0100)]
[lib] fix quote doubling when using "show conf"
Christophe Varoqui [Wed, 19 Nov 2008 21:52:57 +0000 (22:52 +0100)]
[lib] fix compilation warnings
Newer gcc versions are more strict with was we pass a format arg
to *printf(). Please it.
Christophe Varoqui [Wed, 19 Nov 2008 21:26:13 +0000 (22:26 +0100)]
[lib] a little try with bold term chars
... to force feedback from the community. If proven to be harmful,
I can still revert the change, but it really enhance readability of
"show topo" and "multipath -l", in my opinion.
Christophe Varoqui [Wed, 19 Nov 2008 21:17:50 +0000 (22:17 +0100)]
[lib] reset multipath field widths before printing topology
Doing a "show topo" after "show maps" gave different output than "show topo"
on a freshly started multipathd or than "multipath -ll". This is due to
"show map" doing a get_multipath_layout(), which result is persistent, and
affects all subsequent users of the snprint_*() functions.
This patch ensures a predictable output format by reseting the multipath
field widths in snprint_multipath_topology().
Christophe Varoqui [Tue, 18 Nov 2008 23:05:21 +0000 (00:05 +0100)]
[lib] printing readability enhancements
o use the ascii-mode pstree branching representation
o discard the bracketing around status informations
Christophe Varoqui [Tue, 18 Nov 2008 00:44:31 +0000 (01:44 +0100)]
[multipath] ignore header sizes when printing through "multipath -l"
This suppresses spurious whitespaces in the output.
Christophe Varoqui [Thu, 13 Nov 2008 22:52:20 +0000 (23:52 +0100)]
[multipathd] add "show maps format ..." cli command
Just like "show paths format ...", it gives users more control
over the report format of multipaths information.
Example:
$ sudo multipathd -k'show maps format "%n %s %S %d %t %r %Q %N"'
name vend/prod/rev size sysfs dm-st write_prot queueing paths
353333330000007d0 Linux,scsi_debug 8.0M dm-1 active rw - 2
353333330000007d1 Linux,scsi_debug 8.0M dm-2 active rw - 2
35333333000000bb8 Linux,scsi_debug 8.0M dm-3 active rw - 2
35333333000000bb9 Linux,scsi_debug 8.0M dm-4 active rw - 2
Christophe Varoqui [Tue, 4 Nov 2008 00:20:11 +0000 (01:20 +0100)]
Amend previous patch
Forgot to remove another fix trial remnent before commit
Christophe Varoqui [Mon, 3 Nov 2008 23:26:42 +0000 (00:26 +0100)]
[multipath] re-enable path checks in "multipath -ll"
Path checker state was reported as [undef], even when the -ll
flag was passed to multipath. This was regression.
Christophe Varoqui [Sun, 2 Nov 2008 01:19:17 +0000 (02:19 +0100)]
[multipathd] set offline path state to faulty
If not explicitely set to faulty, the default is undef.
Christophe Varoqui [Sun, 2 Nov 2008 00:52:21 +0000 (01:52 +0100)]
[lib] fix the scsi state fetching in sysfs
Wrong lookup directory for the "state" node
Christophe Varoqui [Sun, 2 Nov 2008 00:46:25 +0000 (01:46 +0100)]
[hwtable] fix old style getprio for IBM hardware
This issue failed the build. Note to contributers, upstream has a
changed its way to specify prioritizers and checkers (.so) :
.getprio => .prio_name
.checker_index => .checker_name
Yanqing Liu [Thu, 23 Oct 2008 21:00:33 +0000 (23:00 +0200)]
[lib] add defaults for Dell M3000 and M3000i
Christophe Varoqui [Thu, 23 Oct 2008 20:47:20 +0000 (22:47 +0200)]
[lib] terminate the words fetched by get_word()
get_word is used to parse words from device maps and status
for example. Not terminating these words ended up with unpleasant
outputs.
Chandra Seetharaman [Thu, 16 Oct 2008 00:20:01 +0000 (17:20 -0700)]
Add support for couple of IBM storage devices
Few of the IBM rdac storage devices are not available in the multipath
tools. This patch adds support for those.
Signed-Off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Martin Petermann [Wed, 15 Oct 2008 20:42:31 +0000 (22:42 +0200)]
[lib] libdevmapper api check
In libmultipath Makefile it is checked if the
symbol dm_task_no_flush is defined within the device mapper
library. On my system beside the library there exists a
symbolic link within the same directory pointing to this
library and containing libdevmapper.so in it's name:
lrwxrwxrwx 1 root root 20 Sep 22 22:15 /lib64/libdevmapper.so -> libdevmapper.so.1.02
-rwxr-xr-x 1 root root 89928 Feb 14 2008 /lib64/libdevmapper.so.1.02
In this case "grep -c" returns a 2 instead of 1 that is assumed
in the Makefile. I changed this check to not equal zero.
Christophe Varoqui [Sat, 11 Oct 2008 00:00:22 +0000 (02:00 +0200)]
[lib] add offlined paths logic
o don't check offlined paths
Avoids log polution and useless work
o display offlined status
This information is quite useful because offlining can be done
by the kernel as a response to an unsane situation, but un-offlining
is not automatic. This helps the offlining being aknowledged by
admins.
Christophe Varoqui [Tue, 30 Sep 2008 21:39:27 +0000 (23:39 +0200)]
[multipathd] add "quit" cli command
"exit" or "quit" may be more straight-forward than CTRL-D
Put dummy cli commands in place for auto-generated help,
even if we exit from the socket client code before sending
the command packet to the daemon.
Christophe Varoqui [Sun, 28 Sep 2008 23:37:02 +0000 (01:37 +0200)]
[multipathd] add "show wildcards" cli command
The fact I had to look at the code to find the wildcards to use
in "show paths format ...", "show multipath format ..." and
"show pathgroup format ..." was a clear sign that more help was
necessary.
The "show wildcards" command outputs :
multipath format wildcards:
%n name
%w uuid
%d sysfs
%F failback
%Q queueing
%N paths
%r write_prot
%t dm-st
%S size
%f features
%h hwhandler
%A action
%0 path_faults
%1 switch_grp
%2 map_loads
%3 total_q_time
%4 q_timeouts
%s vend/prod/rev
path format wildcards:
%w uuid
%i hcil
%d dev
%D dev_t
%t dm_st
%T chk_st
%s vend/prod/rev
%C next_check
%p pri
%S size
pathgroup format wildcards:
%s selector
%p pri
%t dm_st
And for example, "show paths format foo:%d:%S:%i", outs
foo:dev:size:hcil
foo:sda:149G:2:0:0:0
Christophe Varoqui [Sun, 28 Sep 2008 22:44:46 +0000 (00:44 +0200)]
[libmultipath] fixes for "show paths format"
o undue 1-char rollback when encountering unknown wildcard
o fix segfault when format starts with an unknown wildard
o continue parsing the format after an unknown wildcard
Dave Wysochanski [Sun, 28 Sep 2008 20:32:29 +0000 (22:32 +0200)]
[lib] Increase bindings file lock timeout to avoid failure of user_friendly_names
On setups with a large number of paths / multipath maps, contention for
the advisory lock on the bindings file may take longer than 3 seconds,
and some multipath processes may create maps based on WWID despite having
user_friendly_names set. Increasing the timeout is a simple fix that
gets us a bit further.
Jim Lester [Sun, 21 Sep 2008 10:36:33 +0000 (12:36 +0200)]
[lib] new hardware from compellent in defaults table
Christophe Varoqui [Wed, 10 Sep 2008 22:17:37 +0000 (00:17 +0200)]
[multipathd] add "show status" cli command
For now just print the number of paths in each path checker state,
if not zero. For example :
path checker states:
up 2
down 1
ghost 1
Mike Anderson [Wed, 20 Aug 2008 21:55:31 +0000 (23:55 +0200)]
[lib] add IBM IPR to hwtable.
Andrey Panin [Wed, 20 Aug 2008 21:17:45 +0000 (23:17 +0200)]
[lib] add IBM DS3400 to hwtable
Guido Günther [Tue, 19 Aug 2008 18:54:25 +0000 (20:54 +0200)]
[lib] udev as of 0.124 doesn't support -s anymore
sysfs as of 0.124 doesn't support -s anymore and the whole sysfs code
got removed, we'll have to use the devnodes in /dev/ from now on. I
also changed the last remaining call from /sbin/scsi_id to
/lib/udev/scsi_id.
Hannes Reinecke [Wed, 23 Jul 2008 20:49:52 +0000 (22:49 +0200)]
Fix whitespace issues
One wouldn't believe how many of them are in the code ...
Christophe Varoqui [Sat, 19 Jul 2008 17:11:23 +0000 (19:11 +0200)]
[lib] create read-only multipath if rw try failed
May be soon the devmapper will return more precise return codes.
Use that for now.
Christophe Varoqui [Sat, 19 Jul 2008 16:26:54 +0000 (18:26 +0200)]
[lib] abstract a little more devmapper internals
o move DEFAULT_TARGET define from defaults.h to devmapper.h
o rename DEFAULT_TARGET into TGT_MPATH (multipath)
o introduce TGT_PART (linear)
o remove the type param from functions used only with TGT_MPATH
o abstract dm_addmap() with to wrappers dm_addmap_create() and
dm_addmap_reload(). Wrappers don't require the type and task
params.
o move the dm_addmap(DM_DEVICE_CREATE, ...) cleanup on failure
from configure.c into devmapper.c::dm_addmap_create()
Christophe Varoqui [Sat, 19 Jul 2008 16:24:08 +0000 (18:24 +0200)]
[kpartx] don't return 0 if a partition removal failed
Benjamin Marzinski [Wed, 11 Jun 2008 18:46:16 +0000 (13:46 -0500)]
multipath-tools: DESTDIR makefiles cleanup
This patch makes the $(DESTDIR) makefile option for multipath-tools more
useful. First, it makes sure that everything that's installed uses it.
Second, it removes the forced root installs, so that you can can install
to any $(DESTDIR) that you have permissions for, even if you aren't
root.
Signed-off-by: Benjamin Marzinski <bmarzins redhat com>
Christophe Varoqui [Thu, 12 Jun 2008 21:36:08 +0000 (23:36 +0200)]
[multitpathd] add "show paths format" cli command
to let users extract custom reports from the daemon data stractures.
format is printf fmt-like with :
%w uuid
%i hcil
%d dev
%D dev_t
%t dm_st
%T chk_st
%s vend/prod/rev
%C next_check
%p pri
%S size
example:
$ mutlipathd -k'show paths format "/dev/%d is a path to %w"'
Stefan Haberland [Wed, 11 Jun 2008 20:51:37 +0000 (22:51 +0200)]
[lib] new hwtable entry
S/390 FBA DASDs are not blacklisted because they are not detected correctly.
Added S/390 FBA DASDs to hwtable.c to solve this problem
Hannes Reinecke [Mon, 2 Jun 2008 08:52:30 +0000 (10:52 +0200)]
Allow zero paths for multipath map
There is no reason why multipath should handle the removal
of the last path from a multipath map different than any other
path removal. In fact, in doing so we'll shed the stale reference
to the dead device in the map and allow for a clean reconnection.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Christophe Varoqui [Tue, 20 May 2008 13:35:10 +0000 (15:35 +0200)]
fine-grained hwentry config override
== Before:
adding
device {
vendor EMC
product FOO
checker tur
}
resets all hwentry vars not specified in the block to internal
defaults ... losing the precious bits in the internal default
hwtable.
== After:
adding the same block retains all info present in the
default hwtable and override only the bits specified in the conf
file.
Christophe Varoqui [Sun, 18 May 2008 13:07:13 +0000 (15:07 +0200)]
print the multipath map write-protection status
wildcard is %r
appears in "multipath -l" and cli command "show topo"
Christophe Varoqui [Sun, 18 May 2008 13:23:30 +0000 (15:23 +0200)]
don't include header length in column width in "show topo"
which aligns daemon output to "multipath -l" output
Christophe Varoqui [Sun, 18 May 2008 13:32:06 +0000 (15:32 +0200)]
add write protect column to "show maps status"
Christophe Varoqui [Sun, 18 May 2008 15:48:37 +0000 (17:48 +0200)]
apply the same treatment to prioritizer than Ben applied to checkers
ie:
o don't so prio shared object if not used
o error if prioritizer lib is not found instead of falling back to default
I also had to move up the multipath_dir initialization in load_config()
because add_prio/add_checker need the var to load the shared object.
Also realize the multpath_dir keyword has to be set before default:prio
and default:checker in the config file.
A correct solution would be to defer the loads to the end of the config
file processing. Contribution welcome.
Christophe Varoqui [Mon, 19 May 2008 22:07:45 +0000 (00:07 +0200)]
add '-r' option to force devmap reload
This takes care of updating the write-protection flag
of the devmap in case the write-prot of the underlying
paths has changed (and the kernel somehow has discovered
so).
Now a RO->RW change scenario for a multipathed device can
be treated with :
1/ echo 1 >/sys/block/XX/device/rescan on all paths to dev
2/ multipath -r dev
Which minimaly fulfills my needs with Symmetrix SRDF spliting
in interim of more collaboration from other subsystems.
Christophe Varoqui [Tue, 20 May 2008 08:35:18 +0000 (10:35 +0200)]
make "show conf" output usable as a /etc/multipath.conf
Some multipath.conf keywords take strings values, which can embed
spaces. Add quotes to those.
vendor
product
hwhandler
getuid
features
udev_dir
multipath_dir
and blacklist regexps
Christophe Varoqui [Wed, 21 May 2008 19:47:37 +0000 (21:47 +0200)]
track .gitignore so everyone can benefit from its presence
Christophe Varoqui [Tue, 13 May 2008 22:41:32 +0000 (00:41 +0200)]
[lib] adapt checker print function to Ben's change
Benjamin Marzinski [Tue, 13 May 2008 22:36:29 +0000 (00:36 +0200)]
[checkers]
checker_lookup() silently returns the default checker if the requested
one can't be loaded. Even worse, it the default checker can't be loaded,
it gets stuck in an infinite loop.
It seems to me that if the requested checker can't be loaded, we should
just throw an error. That's what this patch does.
multipath.conf should be order independent, and with the existing
checker code, it isn't. The multipath_dir had to be set before
you could set a checker, otherwise the checker load failed (since the
multipath_dir wasn't specified).
Hannes Reinecke [Wed, 30 Apr 2008 09:04:55 +0000 (11:04 +0200)]
Fixup Makefiles
We're now using dlopen() etc, so we should link to libdl
explicitely instead of relying on some other library to do
this for us.
And '-fPIC' is a mandatory CFLAGS setting now, not an
optimisation.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 30 Apr 2008 09:04:50 +0000 (11:04 +0200)]
Remove DAEMON defines
We're now building just one shared library for both programs,
multipath and multipathd. So any DAEMON defines are quite
pointless.
Remove them and use 'mpp->waiter == NULL' to distinguish between
multipath and multipathd where required.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 30 Apr 2008 09:01:04 +0000 (11:01 +0200)]
block SIGPIPE before writing to a pipe
We have to block SIGPIPE before we're writing to the communication
pipe otherwise the daemon will be killed if the listening program
terminates prematurely.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 30 Apr 2008 09:04:59 +0000 (11:04 +0200)]
Make modules directory configurable
As we know have a separate directory for the various shared
libraries we should make this configurable.
And use that variable a prefix for dlopen() to make that
work correctly.
Signed-off-by: Hannes Reinecke <hare@suse.de>