Hannes Reinecke [Wed, 12 Jan 2011 09:13:04 +0000 (10:13 +0100)]
multipathd: Fix uxlsnr race condition on shutdown
The multipath daemon deallocates some memory structures
upon shutdown which have been allocated in the thread
context of uxlsnr. Upon shutdown this thread is already
done for, taking it's memory structures with it.
So we need to establish a proper pthread cleanup
handler here to ensure the memory structures are
freed correctly.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 20 Nov 2008 11:14:42 +0000 (12:14 +0100)]
Rework sysfs device handling in multipathd
Relying on sysfs devices has the disadvantage that the device
might already been gone by the time we look at it. And we don't
actually need it for eg device-mapper events as we can get all
required information via the device-mapper ioctl.
So only access sysfs if we absolutely have to and try to get
the information from other places if possible.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 17 May 2011 10:52:39 +0000 (12:52 +0200)]
multipath: add SuSE init file
This patch adds /etc/init.d/boot.multipath file for SuSE.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 13 Jan 2009 14:28:23 +0000 (15:28 +0100)]
Checker name is not displayed on failure
If add_checker() isn't able to locate the checker
it won't display the name in free_checker().
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 18 Nov 2008 09:57:27 +0000 (10:57 +0100)]
Unload priority modules
We only load the priority modules, but never unload them.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 17 Mar 2010 07:32:51 +0000 (08:32 +0100)]
Display avg priority as group priority
Now average priority is used as path group priority, instead of sum of
priorities of the paths. But while displaying group priority, sum is
being displayed. Change it to print the average priority.
When there are no enabled paths, print 0 as priority.
Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 12 Jan 2011 09:07:58 +0000 (10:07 +0100)]
libmultipath: Improve debugging of log messages
With the current definition of log messages we
only see something utterly pointless when using
gdb:
(gdb) print *(struct logmsg *)la->buff
$15 = {prio = 6, next = 0x80015a68,
str = 0x73687574646f776e <Address 0x73687574646f776e out of bounds>}
With this fix we are able to see the message
directly:
(gdb) print *(struct logmsg *)la->buff
$6 = {prio = 5, next = 0x8001b220,
str = 0x8001d240 "--------shut down-------\n"}
References: bnc#659859
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 27 May 2010 11:51:23 +0000 (13:51 +0200)]
libmultipath: rework sysfs handling
sysfs_get_device() is called extremely often, so we need
to make sure to have that as streamlined as possible.
So remove all unused fields and use caching as often as
possible.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 4 May 2009 14:46:58 +0000 (16:46 +0200)]
libmultipath: update waiter handling
The current 'waiter' structure accesses fields which belong
to the main 'mpp' structure, which has a totally different
lifetime. With this patch most of these dependencies are
removed and the 'waiter' structure can run independently
of the main 'mpp' structure, reducing the risk of
use-after-free faults.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 28 Jan 2011 08:21:15 +0000 (09:21 +0100)]
libmultipath: do not fallback to search /proc/partitions
devt2devname() reverse-maps the device number to the
device name. However, when a device is not found in
/sys/block/dev it's pointless to retry searching for
it in /proc/partitions, as both carry the same information.
And the search in /proc/partitions is only meant for
systems not providing /sys/block.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 30 Mar 2010 08:53:05 +0000 (10:53 +0200)]
Start uevent service handler from main thread
We should start the uevent handler as early as possible so as
to not miss out any events. However, we cannot process these
events until after all paths have been discovered. So we
should be starting the uevent service routine only after
the discovery process.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 25 Feb 2009 15:10:16 +0000 (16:10 +0100)]
Use lists for uevent processing
We now have proper list definitions, so we might as well use them
for uevent processing. And we can clean up signalling, too;
the pthreads condition signalling is unreliable, as a condition
signal might be lost if we're in the middle of processing. So
we should rather check the queue status prior to wait for a
condition.
And we can introduce a pthread cleanup handler, as well.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 4 May 2009 12:11:18 +0000 (14:11 +0200)]
Remove sysfs_attr cache
The sysfs attribute cache was meant to speed up sysfs accesses.
However, we need to update the cache values on each access, so
there is no speedup to be had.
So remove it and save memory.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 25 Sep 2009 09:51:25 +0000 (11:51 +0200)]
Fixup strip trailing whitespaces for getuid return value
The getuid callout might return a wwid with trailing
spaces (or containing only spaces). The existing
fixup code will only work if the getuid callout
returns a wwid with the entire space used up.
So fixup this and also update the logging output
to correctly state '<empty>' if the getuid was
found to be empty.
References: bnc#542085
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 15 Mar 2011 10:25:38 +0000 (11:25 +0100)]
Check return value for select_alias()
select_alias() might fail, so we need to check the return code
here.
References: bnc#642846
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 15 Mar 2011 10:32:34 +0000 (11:32 +0100)]
Use enum free_path_mode for free_paths argument
The 'free_paths' argument is really an enum, so we can as well
mark it as such.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 13 May 2011 10:21:16 +0000 (12:21 +0200)]
vector paranoia
As usual error checking in vector.c is non-existent.
In this case, if realloc fails we will return NULL but
leave ->allocated on the previous value.
And checking for empty vectors isn't a bad idea, either.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 28 Apr 2009 09:03:10 +0000 (11:03 +0200)]
Update cli request processing
Add error checking to cli packet processing and some whitespace fixes.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 23 Jul 2008 08:42:16 +0000 (10:42 +0200)]
Implement 'bindings_file' option
Early in boot /var might not be accessible, so this patch implements
a 'bindings_file' option which allows to place the persisting bindings
file at a different location.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 13 May 2011 07:55:54 +0000 (09:55 +0200)]
kpartx: Intendation fix in devmapper.c
Wrong intendation.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 5 May 2011 06:53:43 +0000 (08:53 +0200)]
Use regmatch when checking for duplicates in hwtable
When elimininating duplicates in the config file we should
rather be using regmatch, otherwise it's near to impossible to
guess how the actual regexp in the built-in hardware table
is specified.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 5 May 2011 06:35:01 +0000 (08:35 +0200)]
Update hwtable factorization
During hwtable factorization we should _not_ merge the entries,
as the original entries might be regular expressions. Thus they
might match more devices than the new, user-provided one.
So during factorization we should _not_ remove duplicate
entries, but rather update the new entries with the missing
defaults and scan the table backwards.
With this we'll be using the modified entries for the matching
devices _only_, leaving all others intact.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 4 May 2011 09:56:40 +0000 (11:56 +0200)]
Specify prioritizer in the multipath section, too
We should allow to set the prioritizer in the multipath section,
too, as some arrays might be configured to run in different
modes.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 4 May 2011 09:38:53 +0000 (11:38 +0200)]
Static Load balancing prioritizer
'Weighted path' is a new path prioritizer for device mapper
multipath, where specific paths and the corresponding priority
values can be provided as arguments.
This prioritizer assigns the priority value provided in the
configuration file based on the comparison made between the
specified paths and the path instance for which this is called.
Paths can be specified as a regular expression of devname
of the path or as hbtl information of the path.
Syntax:
weightedpath <hbtl|devname> <regex1> <prio1> <regex2> <prio2> ...
Examples:
prio "weightedpath"
prio_args "hbtl 1:.:.:. 2 4:.:.:. 4"
prio "weightedpath"
prio_args "devname sda$ 10 sde$ 20"
This prioritizer allows user to set static load balancing
for devices. Useful when user has prior knowledge of path
performance difference or unavailability of certain paths.
Signed-off-by: Vijayakumar Balasubramanian <vijaykumar@hp.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 20 Mar 2008 09:50:40 +0000 (10:50 +0100)]
Synchronize dm states for IO errors
When a real hardware IO error occurs, the path checker will return
PATH_UP, causing the dm state from the kernel never to be updated.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 1 Feb 2010 08:46:57 +0000 (09:46 +0100)]
Add 'max_polling_interval' config variable
We should be able to set the 'max_polling_interval' variable
manually. Especially systems requiring precise failover timing
will want to disable the automatic polling interval increase.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 17 Feb 2011 08:05:57 +0000 (09:05 +0100)]
libmultipath: do not access dm structures after dm_task_destroy
device-mapper has the habit of freeing up all internal structures
after dm_task_destroy. So we shouldn't try to access any of these
later on.
References: bnc#672857
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 28 Jan 2010 14:31:02 +0000 (15:31 +0100)]
Correctly remove logical partition maps
kpartx will generate logical partition maps inside maps for the
extended partition. So we need to update multipath -f to handle
this situation.
Signed-off-by: Cong Meng <cmeng@novell.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 4 May 2011 06:29:27 +0000 (08:29 +0200)]
rdac checker: Whitespace cleanup
Some whitespace fixes for rdac checker.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 3 May 2011 14:27:29 +0000 (16:27 +0200)]
libmultipath: Fix possible string overflow
basenamecpy() and devt2devname() need to be passed in the
length of the string into which the modified value should
be copied. Otherwise a string overflow can be induced.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 3 May 2011 14:13:16 +0000 (16:13 +0200)]
More debugging output for feature changes
Add some more debugging output to track feature changes.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 3 May 2011 15:04:27 +0000 (17:04 +0200)]
Fixup debugging in dmparser.c
Update all call to 'fprintf' to use condlog().
And add some more debugging output.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 3 May 2011 13:55:39 +0000 (15:55 +0200)]
Correctly update feature strings
The 'features' string might contain arbitrary features,
so we shouldn't assume anything here.
This patch implements a parser for properly adding
and removing selected features whilst keeping the
'features' string syntactically correct.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 13 Mar 2009 14:21:29 +0000 (15:21 +0100)]
Select 'features' from multipath configuration
For some setups we need to set the 'features' keyword from the
multipath configuration setting.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 4 Mar 2009 12:36:46 +0000 (13:36 +0100)]
Increase uevent buffer size
The default kernel buffer size for uevent has been increased to
2k, we should be doing this in multipath, too.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 27 May 2010 13:02:56 +0000 (15:02 +0200)]
libmultipath: remove strcmp_chomp()
We can as well sanitize the strings before calling
find_path_by_devt(), thus removing the need for
strcmp_chomp() altogether.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 3 May 2011 09:14:26 +0000 (11:14 +0200)]
Remove sysfs_lookup_devpath_by_subsys_id()
Unused, should be removed.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 3 May 2011 11:45:49 +0000 (13:45 +0200)]
libmultipath: resolve hash collisions in pgcmp()
pgcmp() is using a simple xor algorithm for hashing. Main intention
here is to have a quick comparison if two paths are identical.
However, this algorithm is prone to hash collisions, so even if
two hashes match we should still check the individual paths to
avoid collisions.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 18 Feb 2011 07:25:59 +0000 (08:25 +0100)]
libmultipath: correct path count in setup_map()
We should be counting both, UP and GHOST paths when counting the
number of available paths. Otherwise the count might become
negative and multipath would never switch into recovery mode.
References: bz#677821
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 3 May 2011 11:47:13 +0000 (13:47 +0200)]
Make status variable local
The 'status' structure field in struct multipath can also be made
local.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 22 Oct 2009 14:25:57 +0000 (16:25 +0200)]
Make params variable local
The 'params' structure field in struct multipath is a purely local
variable, and as such shouldn't be part of the main structure.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 5 Nov 2009 13:52:05 +0000 (14:52 +0100)]
multipath segfaults if configuration file contains errors
This patch prevents multipath from crashing on invalid
configuration file when mandatory configuration values
are missing.
References: bnc#540118
Signed-off-by: Leonardo Chiquitto <lchiquitto@novell.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 27 Jan 2010 07:48:11 +0000 (08:48 +0100)]
Use '--replace-whitespace' option for scsi_id
Some SCSI devices will return an identifier with spaces in it.
As we're using this name as the default device-mapper name we
should be reformatting it to replace all spaces with underscores
so as not to confuse device-mapper.
References: bnc#572209
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 3 May 2011 08:30:47 +0000 (10:30 +0200)]
Asynchronous mode for tur checker
When a path is going down I/O will stall until the underlying
device becomes unblocked. This will stall the entire checker loop
and cause severe delays.
This patch implements an asynchronous mode for the 'TUR' checker,
whereby the actual ioctl is executed in its own thread. The
checkerloop then just examines the state of this separate thread
and can continue even if the ioctl is blocked.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 3 May 2011 08:29:28 +0000 (10:29 +0200)]
Move setup_thread_attr() to uevent.c
The function will be used by other instances, too, so move it
over to the library.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 16 Sep 2009 10:23:30 +0000 (12:23 +0200)]
TUR checker should not return 'failed' for reservation conflict
Some SCSI-3 arrays might return 'Reservation conflict' even
for TEST UNIT READY. But this doesn't indicate that the path
is faulty. So we should return the proper status here.
References: bnc#498413
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 18 Jun 2010 10:34:43 +0000 (12:34 +0200)]
directio: Reset 'running' parameter
Upon failure the 'running' parameter is not updated correctly,
which might cause the directio checker to always report failure.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 3 May 2011 07:07:52 +0000 (09:07 +0200)]
Use timeout parameter for directio
As checkers now have a timeout we should be using this one for
directio, too.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 2 Jun 2010 10:49:37 +0000 (12:49 +0200)]
libmultipath: check argument length in execute_program()
The 'path' argument of execute_program() is actually an
array with fixed length. So we should be using the same
length here to avoid overflows. And we should check the
number or arguments, too, as the list we're using is
static, too.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 3 May 2011 08:06:59 +0000 (10:06 +0200)]
readsector0: block count calculation wrong
readsector0/libsg is getting the number of blocks wrong, as it
doesn't check the length of the buffer.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 2 May 2011 14:11:50 +0000 (16:11 +0200)]
checkers: argument paranoia
After suffering from the umpteenth crash it's time to add
argument validation to checkers.c
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 26 Apr 2010 08:15:05 +0000 (10:15 +0200)]
Use refcounting for checkers
The checkers are not accessed directly but rather via private
copies of the original instance. However, the pointers in the
private copy point to the original ones, making them potentially
invalid when the original instance is deleted.
So we need to introduce proper refcounting here.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 6 Dec 2010 07:38:10 +0000 (08:38 +0100)]
kpartx: Add option '-f' to force devmap creation
Under some circumstances the user needs to override the
'no_partitions' feature of a multipath device.
This patch adds an option '-f' to facilitate this.
Signed-off-by: Libor Pechacek <lpechacek@novell.com>
Acked-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 23 Jul 2008 12:15:12 +0000 (14:15 +0200)]
Add 'no_partitions' feature
The 'no_partitions' feature serves as a trigger for kpartx for not
creating any partitions on that device. This is required if eg
the device is used as a system disk for VM guests.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 21 Aug 2009 13:57:55 +0000 (15:57 +0200)]
Implement 'update' option for kpartx
Currently kpartx only knows about 'add' or 'remove'; however,
it should also be invoked when someone had changed the partition
table. Only in this case it should do a combination of both,
namely add new partition mappings and remove stale ones.
Hence an 'update' option is required.
Signed-off-by: Petr Uzel <puzel@novell.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 2 May 2011 13:44:43 +0000 (15:44 +0200)]
kpartx: Indentation fix
Another small step in the neverending war between
indents and spaces.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 3 May 2011 07:38:30 +0000 (09:38 +0200)]
Add compability flag LIBDM_API_COOKIE
Newer device-mapper versions use 'cookies' to synchronize with udev.
As this is not available with older versions we need to add stubs
to make it compile on older versions.
And we only need to update the device-mapper version in
dm_lib_prereq() if the flag is set.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 2 May 2011 10:03:21 +0000 (12:03 +0200)]
Merge branch 'master' of git://git./linux/storage/multipath-tools/
Benjamin Marzinski [Wed, 27 Apr 2011 19:52:14 +0000 (14:52 -0500)]
multipath: clear checker message
Clear the checker message at the start of get_state, so that stale checker
messages aren't accidentally printed.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Wed, 27 Apr 2011 03:23:57 +0000 (22:23 -0500)]
multipath: rename netapp.c to ontap.c
This is the second part of the NetApp patch from George Martin. It simply
renames netapp.c to ontap.c and edits the Makefile to build it.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Mon, 25 Apr 2011 04:02:59 +0000 (23:02 -0500)]
multipath: changes to NetApp's prioritizer
This is a patch sent to me by Martin George from NetApp. It changes the
prioriziter name from netapp to ontap, and adds some minor enchancements to
the prioritizer. I can send another patch to change the file names to match,
but that makes it harder to see the full file history in git.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Mon, 25 Apr 2011 03:48:00 +0000 (22:48 -0500)]
multipath: recheck all priorities when a path comes back up
For group_by_prio paths, when a path goes down, its possible that the
priorities of the paths will be readjusted, and the multipath device will be
reloaded with a different path layout. However, downed paths don't get their
priority checked, so when the path comes back up and the original priorities
are restored, multipathd may not notice that the path layout needs to be
recalculated. This patch makes multipathd recalculate the the priorities of all
the paths when a path is restored, and reloads the map if any of them have
changed. Also, when a path is restored, multipathd checks twice in
check_path if the pathgroup needs switching. This should only happen once.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Mike Snitzer [Wed, 20 Apr 2011 21:24:00 +0000 (17:24 -0400)]
multipathd: use 0 for initial pg if there are no priority groups
dm-multipath now accommodates a DM table that doesn't have any priority
groups, see: http://git.kernel.org/linus/
a490a07a67b7a37
That kernel change imposes that multipathd must pass 0 for the initial
priority group if there aren't any priority groups (currently passes 1).
There is no need to check the multipath target version to decide whether
to pass an initial_pg of 0 or 1 because until recently dm-multipath
never accommodated a DM table with no priority groups.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Jun'ichi Nomura [Wed, 20 Apr 2011 09:20:09 +0000 (18:20 +0900)]
multipath-tools: Add new NEC diskarray to internal hardware table
Hi Christophe,
This patch adds an entry for new NEC Storage M series to internal hwtable.
Could you include this change in your tree?
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Hannes Reinecke [Fri, 15 Apr 2011 12:01:25 +0000 (14:01 +0200)]
Merge branch 'master' of git://git./linux/storage/multipath-tools/
Benjamin Marzinski [Sat, 9 Apr 2011 08:03:22 +0000 (10:03 +0200)]
Remove tmp loopdev created by 'kpartx -l' if no partitions were found
Moger, Babu [Fri, 8 Apr 2011 19:06:15 +0000 (13:06 -0600)]
multipath-tools: report different piority value for rdac if io-shipping is enabled
This patch adds code to report different priority value if the storage is configured with io-shipping.
It sets the bit 3 if io-shipping is enabled. This is to differentiate between different modes.
Signed-off-by: Babu Moger <babu.moger@lsi.com>
Reviewed-by : Yanling Qi <yanling.qi@lsi.com>
Reviewed-by : Somasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com>
Moger, Babu [Fri, 8 Apr 2011 19:04:45 +0000 (13:04 -0600)]
multipath-tools: report PATH_UP for both path groups in rdac if io-shipping is enabled
This patch reports PATH_UP for both the path groups if the RDAC storage is configured with i/o shipping.
Signed-off-by: Babu Moger <babu.moger@lsi.com>
Reviewed-by: Yanling Qi <yanling.qi@lsi.com>
Reviewed-by: Somasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com>
Moger, Babu [Fri, 8 Apr 2011 19:02:44 +0000 (13:02 -0600)]
multipath-tools: Set the rdac TAS bit if it changeable
This patch sets the rdac TAS bit if it is changeable. This is called only once
per lun during the discovery.
The Task Aborted Status (TAS) bit in Control Mode Page (Page 0x0A) controls
the behavior of aborted tasks. By default, the TAS bit is set to zero. The
rdac checker should issue a mode sense page 0x0A to determine the TAS bit
value and whether or not the TAS bit is changeable. If the TAS bit is set
to 0 and changeable, the rdac checker should issue a mode select page 0x0A
to change TAS to 1 and save it.
Signed-off-by: Babu Moger <babu.moger@lsi.com>
Reviewed-by : Yanling Qi <yanling.qi@lsi.com>
Reviewed-by : Somasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com>
Moger, Babu [Tue, 1 Mar 2011 19:08:24 +0000 (12:08 -0700)]
multipath: Retry host transient errors for rdac checker
Sometimes if the host is in transient state, we need to wait till the devloss timeout to
expire before switching path group. We have seen in some cases path group switch happens
even before the devloss timeout expire. This patch fixes the problem for rdac checker..
Signed-off-by: Babu Moger <babu.moger@lsi.com>
Hannes Reinecke [Tue, 8 Feb 2011 08:24:46 +0000 (09:24 +0100)]
Merge branch 'master' of git://git./linux/storage/multipath-tools/
Benjamin Marzinski [Mon, 20 Dec 2010 06:02:09 +0000 (00:02 -0600)]
multipath: add allow users to set revision in multipath.conf
Since multipath is able to select hardware entries based on the revision
parameter, users should be allowed to set it in their devices configurations.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Kacper Kowalik [Wed, 2 Feb 2011 17:17:54 +0000 (18:17 +0100)]
[lib] respect LDFLAGS, correct linking order
current HEAD of libmultipath fails to build with -Wl,--as-needed[1] and
doesn't respect LDFLAGS when creating shared libs.
I've attached a patch to fix those issues.
Ritesh Raj Sarraf [Wed, 2 Feb 2011 14:21:46 +0000 (19:51 +0530)]
add -r to make resulting device read-only
This patch adds the ability to create targets which are read-only to
keep from accidentally modifying the newly created device. In some cases,
mounting with -o ro still modifies the device (in the case of ext3
filesystems). I created a small patch that will do this. I have tested it
only to the point that using -a with or without -r produces the desired
effects.
Signed-off-by: Ritesh Raj Sarraf <rsarraf@netapp.com>
Signed-off-by: Wakko Warner <wakko@animx.eu.org>
Hannes Reinecke [Tue, 1 Feb 2011 08:54:31 +0000 (09:54 +0100)]
Merge branch 'master' of git://git./linux/storage/multipath-tools/
Christophe Varoqui [Tue, 1 Feb 2011 08:53:20 +0000 (09:53 +0100)]
Fix Malahal Naineni commit 2b68b83 review highlights
1/ use local stack allocation in dm_drv_get_rq() and dm_drv_prereq()
2/ don't pass argument to dm_drv_prereq() as it's dm-multipath specific
Also rename dm_drvprereq() to dm_drv_prereq() and dm_libprereq() to
dm_lib_prereq() for consistency with dm_drv_get_rq() naming.
Christophe Varoqui [Mon, 31 Jan 2011 23:52:02 +0000 (00:52 +0100)]
[lib] Fix reversion of dm_drvprereq() return codes
Christophe Varoqui [Mon, 31 Jan 2011 23:21:17 +0000 (00:21 +0100)]
Support different 'minio' values for rq and bio based dm-multipath
rq based dm-multipath wants a low minio value for optimal performance
(1-2?) whereas bio-based dm-multipath wants a greater value (128-1000)
Introduce a internal DEFAULT_MINIO_RQ set to 1, and new configuration
parameter name 'rr_min_io_rq' useable in 'default', 'device' and
'multipath' sections. The internal hardware table entries also have
the new 'minio_rq' field.
When dm-multipath driver version is detected >= 1.1.0, only the
rr_min_io_rq (cf), minio_rq (hwe) and DEFAULT_MINIO_RQ (default) are
used. Else, preserve the legacy behaviour.
Christophe Varoqui [Mon, 31 Jan 2011 21:28:25 +0000 (22:28 +0100)]
[lib] Add missing prototype for vector_move_up()
Chaskiel Grundman [Wed, 8 Dec 2010 06:40:13 +0000 (07:40 +0100)]
In case of not connected device, only first condition is checked for PQ in rdac path checker. This patch
corrects the check by masking MSB 3 bits and comparing it with 0x20.
Signed-off-by: Vijay Chauhan <vijay.chauhan@lsi.com>
Benjamin Marzinski [Tue, 7 Dec 2010 22:44:41 +0000 (23:44 +0100)]
make "show config" show the whole config
Show config wasn't displaying particularly useful results. It only showed
the configuration values if they were different from what they would default
to. This made it harder for users to figure out how multipath was actually
configured. If multipath.conf.defaults was not uptodate, they were
occasionally forced to read the source, wade through debugging output, or
find out experimentally. Even more confusing, after looking at the devices
section, users would mistakenly believe that a device didn't set any value
for an attribute, because the device had it configured to the same thing
as the defaults section. Only after the user tried to change the value
by editting the defaults section, would the attribute appear the devices
section. This has caused some annoyance.
This patch makes the defaults section print out all the default configuration
values, unless they really do have an undefined value when left unconfigured.
For the multipaths and hardware handler sections, all attributes that are
configured are printed.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Fri, 3 Dec 2010 23:58:46 +0000 (17:58 -0600)]
multipath: standardize on path_selector
Since the devices and multipaths sections of multipath.conf use
"path_selector", set the defaults section to use it was well, instead of
"selector".
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Fri, 3 Dec 2010 23:32:53 +0000 (17:32 -0600)]
multipath: update multipathd man page
Add missing items to the multipathd man page.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Fri, 19 Nov 2010 04:34:11 +0000 (22:34 -0600)]
multipath: add checker_timeout default config option
Due to errors with some storage arrays, occasionally a scsi request will get
competely dropped. When this happens, fast_io_fail_tmo and dev_loss_tmo don't
get triggered, and a sychronous checker function might have to wait for the
full timeout. Right now those timeouts are hard-coded to 5 minutes. This
patch changes them to use the scsi cmd timeout,
/sys/block/sd<x>/device/timeout, by default. This can be overridden by the new
default config parameter, checker_timeout, so that user can manually set
an upper bound on how long a sychronous checker might be blocked, without
modifying the generic scsi cmd timeout.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Fri, 19 Nov 2010 03:33:18 +0000 (21:33 -0600)]
multipath: update default configurations
Here are some default configuration changes that I've been sent.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Sun, 14 Nov 2010 21:02:14 +0000 (15:02 -0600)]
multipath: clean up path orphaning and adoption
Make sure that multipathd orphans paths when they don't get included in maps,
to reset them to a consistent state, and make sure that multipath adopts paths
that get picked up during a table reload. However, multipathd shouldn't change
the state or priority of paths when it's updating due to a table reload,
since this can interfere with the checkerloop.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Benjamin Marzinski [Wed, 10 Nov 2010 18:52:20 +0000 (12:52 -0600)]
multipath: sort all pathgroups by priority
Right now, the only path grouping policy that sorts pathgroups by priority is
group_by_prio. For the others, the pathgroups are setup in the order that
their paths are discovered. This can cause a problem when the kernel needs to
switch pathgroups, such as when a path fails. The kernel will simply pick the
first valid pathgroup. If failback isn't set to manual, this can cause
needless pathgroup switching. Even worse, with failback set to manual, which
is the default, the kernel will just continue to use the non-optimal pathgroup
until it fails. This patch makes all path grouping policies except multibus
sort the pathgroups by priority.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Malahal Naineni [Wed, 28 Jul 2010 00:46:19 +0000 (17:46 -0700)]
dm-multipath: typo, strncat instead of strncpy
strncat here doesn't seem right, strncpy should be correct!
Signed-off-by: Malahal Naineni (malahal@us.ibm.com)
PS: But why bother correcting an entry that is going to be deleted
anyway? IMO, just deleting the strncat/strncpy line should be fine too.
Any comments???
Hannes Reinecke [Fri, 18 Jun 2010 10:32:21 +0000 (12:32 +0200)]
Set geometry information for multipath maps
Some programs (most notably grub) try to get the device geometry
information via the HDIO_GETGEO ioctl. While device-mapper provides
this ioctl, it's values have to be set previously.
So we can just use the geometry information from the first path
to set this information for the multipath map.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 18 Jun 2010 10:32:21 +0000 (12:32 +0200)]
Set geometry information for multipath maps
Some programs (most notably grub) try to get the device geometry
information via the HDIO_GETGEO ioctl. While device-mapper provides
this ioctl, it's values have to be set previously.
So we can just use the geometry information from the first path
to set this information for the multipath map.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 30 Nov 2010 07:29:13 +0000 (08:29 +0100)]
Merge branch 'master' of git://git./linux/storage/multipath-tools/
Tim Harder [Sun, 28 Nov 2010 21:12:30 +0000 (13:12 -0800)]
libmultipath: fix snprintf buffer overflows
Hi,
I've attached a patch against the latest git version of multipath-tools
to fix a couple snprintf buffer overflows.
Thanks,
Tim
>From
2d51194853342ba24f3b76e9343b8467a8e55400 Mon Sep 17 00:00:00 2001
From: Tim Harder <radhermit@gentoo.org>
Date: Sun, 28 Nov 2010 12:37:08 -0800
Subject: [PATCH] libmultipath: fix snprintf buffer overflows
Arkadiusz Miskiewicz [Sat, 27 Nov 2010 18:21:21 +0000 (19:21 +0100)]
multipath-tools overflow
On Saturday 27 of November 2010, you wrote:
[...]
> the whole logarea is memset to 0 by logarea_init(), and each dequeued
> message is also memset to 0 by log_dequeue(), so it seems normal that
> msg->str value is 0x0, but it's really its address that matters.
Ok, got it. Pointers, memory areas in my debugging session - are looking
good then.
>
> It's not clear to me : are you actually hitting a bug or is it your
> debug session that puzzles you ?
I'm hitting a bug. multipathd dies for me at that strcpy(). Now I think
the bug is strcpy usage instead of memcpy because I'm building with
-O2 -D_FORTIFY_SOURCE=2 which turns on special glibc overflow
detection.
That detection seem to be smart enough to know that &str area is not
a string memory and aborts the program.
Found similar problem discussed here
http://sourceware.org/ml/binutils/2005-11/msg00308.html
glibc aborts the program:
[pid 13432] writev(2, [{"*** ", 4}, {"buffer overflow detected", 24},
{" ***: ", 6}, {"/home/users/arekm/rpm/BUILD/multipath-tools-0.4.9
/multipathd/multipathd", 71}, {" terminated\n", 12}], 5) = 117
same for valgrind:
**13436** *** strcpy_chk: buffer overflow detected ***: program terminated
==13436== at 0x4024997: VALGRIND_PRINTF_BACKTRACE (valgrind.h:4477)
==13436== by 0x40265F8: __strcpy_chk (mc_replace_strmem.c:781)
==13436== by 0x40EDC06: log_enqueue (string3.h:107)
==13436== by 0x40ED68A: log_safe (log_pthread.c:24)
==13436== by 0x40E296A: dlog (debug.c:36)
==13436== by 0x804ECEC: pidfile_create (pidfile.c:37)
==13436== by 0x804E731: main (main.c:1424)
The bug is not visible if I run multipathd in debug mode (-d).
This patch fixes the problem for me by avoiding false positive on strcpy_chk.
Hannes Reinecke [Tue, 16 Nov 2010 09:19:23 +0000 (10:19 +0100)]
Merge branch 'master' of git://git./linux/storage/multipath-tools/
Christophe Varoqui [Fri, 5 Nov 2010 07:09:44 +0000 (08:09 +0100)]
Merge branch 'master' of git+ssh:///linux/storage/multipath-tools
Benjamin Marzinski [Fri, 5 Nov 2010 04:59:46 +0000 (23:59 -0500)]
multipath: fix multipath locking
In lock_multipath(), if multipathd fails halfway though locking the the path
devices, it doesn't unlock the ones that it already has locked. This
patch fixes that.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Konrad Rzeszutek [Wed, 3 Nov 2010 22:13:02 +0000 (23:13 +0100)]
de-alloc the buf variable if we fail on the first do_rtpg call
Hannes Reinecke [Tue, 7 Sep 2010 08:42:10 +0000 (10:42 +0200)]
Merge branch 'master' of git://git./linux/storage/multipath-tools/
Benjamin Marzinski [Thu, 2 Sep 2010 08:07:15 +0000 (10:07 +0200)]
Fix for bz #566685.
Multipathd now will reload the device if it notices that the
priorities have changed during the checkerloop.
Benjamin Marzinski [Thu, 2 Sep 2010 07:59:26 +0000 (09:59 +0200)]
Fix for bz #560892.
multipath now prints some warnings if it notices problems
with /etc/multipath.conf.