Christophe Varoqui [Thu, 5 Jul 2007 05:44:50 +0000 (07:44 +0200)]
[doc] Remove all statements of readsector0 as default checker
Christophe Varoqui [Thu, 5 Jul 2007 05:41:33 +0000 (07:41 +0200)]
[checkers] directio now is the internal default checker
The directio is more advanced than readsector0 : async and unbuffered.
Make it the default choice.
John Kingman [Wed, 4 Jul 2007 21:38:53 +0000 (23:38 +0200)]
[checkers] handle >512 sector size in readsector0
I encountered a problem with the sg_read() routine in readsector0.c
while testing an InfiniBand target having 4096 byte sectors. The
sg_read() routine assumes that sectors are 512 bytes long.
A patch for the problem follows.
Signed-off-by: Christophe Varoqui <christophe.varoqui@free.fr>
Szabolcs Szakacsits [Tue, 3 Jul 2007 21:10:54 +0000 (23:10 +0200)]
[kpartx] kpartx large file support
Apparently -D_LARGEFILE64_SOURCE doesn't always work:
failed to stat() 40GB-disk.img: Value too large for defined data type
Potential fix what we're using everywhere on many platforms with no
reported LFS problems for 5 years:
Matthias Rudolph [Wed, 27 Jun 2007 21:35:52 +0000 (23:35 +0200)]
[Prioritizer] HDS update
o queue_if_no_path in hwtable.c
o tur instead of readsector0 in hwtable.c
o get prio with device name instead of major:minor in hwtable.c and pp_hds_modular.c
Signed-off-by: Christophe Varoqui <christophe.varoqui@free.fr>
Guido Guenther [Tue, 19 Jun 2007 07:15:19 +0000 (09:15 +0200)]
Ease installation of unstripped binaries
Introduce INSTALL_PROGRAM for installing binaries, so that:
make install INSTALL_PROGRAM=install
doesn't stip binaries on installation. The default is to still strip
binaries. Can be very handy for debugging builds.
Signed-off-by: Guido Guenther <agx@sigxcpu.org>
Guido Guenther [Sat, 16 Jun 2007 18:07:15 +0000 (20:07 +0200)]
move kpartx_id to /lib/udev
Guido Guenther [Sat, 16 Jun 2007 18:07:14 +0000 (20:07 +0200)]
Call /lib/udev/scsi_id instead of /sbin/scsi_id
Guido Guenther [Mon, 18 Jun 2007 23:19:10 +0000 (01:19 +0200)]
[kpartx] remove bashisms from kpartx_id
Benjamin Marzinski [Mon, 18 Jun 2007 23:05:28 +0000 (01:05 +0200)]
[libmultipath] care for read-only alias file
On bootup, the bindings file in can't be written to.
This was causing multipath to not check it for aliases.
Now, it the bindings file is on a read-only filesystem,
it will be opened read-only.
Christophe Varoqui [Mon, 18 Jun 2007 22:49:36 +0000 (00:49 +0200)]
[libchecker] restore synchronous checker operation to async-capable checkers
Add a "sync" flag the struct checker to inform the checker the caller wants a synchronous or asynchronous answer to path status request.
Default value is "synchronous" to kept legacy code unchanged.
Set async mode in the daemon checker loop.
Christophe Varoqui [Thu, 14 Jun 2007 23:12:40 +0000 (01:12 +0200)]
[libcheckers] async path checking in the framework
The directio path checker was recently moved to aio API, but the behaviour is still synchronous : io_getevents() blocks until (long) timeout expires.
Truely asynchronous behaviour imposes to
o lower the io_getevents timeout to mininum
o treat a new "pending" checker return status in the daemon (reschedule the checker early for a new io_getevents until the "long" timeout expires)
This patch explores this. This approach has the nice effect to behave well with still-synchronous checker. The daemon should see no regression. But multipath, which assumes synchronous path checking, is for now broken ... to be repaired.
Please comment abundantly this approach, before I start moving ahead.
Hannes Reinecke [Tue, 12 Jun 2007 14:25:55 +0000 (16:25 +0200)]
[libcheckers] use async I/O for directio checker
The directio checker will block until the request is returned.
We should rather use async I/O to guarantee that the checker
will return after a certain time so as not to stall the entire
daemon.
Signed-off-by: Stefan Bader <bader@de.ibm.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christophe Varoqui <christophe.varoqui@free.fr>
Guido Günther [Sun, 10 Jun 2007 22:05:16 +0000 (00:05 +0200)]
[build] exclude hidden dirs from the build candidates
make sure we don't try to build in .svn, .pc, .git or other SCM metadata
directories.
Guido Günther <agx@sigxcpu.org>
Christophe Varoqui [Sat, 9 Jun 2007 16:37:04 +0000 (18:37 +0200)]
[libmultipath] fix debugging macro
Minor cleanup: let the macro do something useful when DEBUG is defined
Signed-off-by: Guido Guenther <agx@sigxcpu.org>
Christophe Varoqui [Sat, 9 Jun 2007 16:35:09 +0000 (18:35 +0200)]
[multipathd] Fix segfault on disappearing paths
The path might already be gone when we process the udev event, in this case
sysfs_device_get return NULL:
Jun 09 16:56:06 | ID_FS_LABEL=
Jun 09 16:56:06 | ID_FS_LABEL_SAFE=
Jun 09 16:56:06 | DEVLINKS=/dev/disk/by-id/scsi-1494554000000000000000000000000010000069d0000000d /dev/disk/by-path/ip-10.0.0.3:3260-iscsi-iqn.2006-12.nix.rs45:storage.disk1-lun-0 /dev/disk/by-uuid/
c8db60a3-7795-45cd-8369-
a0f9ee876032
Jun 09 16:56:06 | DEVNAME=/dev/sda
/block/sda
open '/block/sda'
stat '/sys/block/sda' failed: No such file or directory
Segmentation fault (core dumped)
Signed-off-by: Guido Guenther <agx@sigxcpu.org>
Christophe Varoqui [Thu, 7 Jun 2007 21:18:25 +0000 (23:18 +0200)]
[kpartx] assorted build warning fixes
o dm_task_get_uuid(dmt) returns a const char, but we used a simple char
o remove unused int variable in kpartx.c
Hannes Reinecke [Mon, 21 May 2007 08:39:24 +0000 (10:39 +0200)]
[kpartx] Add handling for SUN partition tables
Not that I've come across one of these disks, but it's a nice testbed for
the stacked partition handling. And might even be useful at one point.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 21 May 2007 08:37:35 +0000 (10:37 +0200)]
[kpartx] Update BSD slice handling
Now that we have the logic to stack dm-tables for partitions we can
handle BSD 'c' slices (which span the entire disk) properly.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 21 May 2007 08:35:40 +0000 (10:35 +0200)]
[kpartx] Update extended partition handling
Currently we don't handle extended partitions at all.
This patch implements a proper handling for extended partitions so that we
first create the dm device for the extended partitions and then the logical
partitions as dm devices on top of the device for the extended partition.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Christophe Varoqui [Thu, 7 Jun 2007 20:39:45 +0000 (22:39 +0200)]
[libmultipath] Fix segfault, when the syfs attribute doesn't exist
open '/class/fc_transport/target7:0:0'/'node_name'
new uncached attribute '/sys/class/fc_transport/target7:0:0/node_name'
add to cache '/sys/class/fc_transport/target7:0:0/node_name'
stat '/sys/class/fc_transport/target7:0:0/node_name' failed: No such file or directory
This would allocate no space for attr->value but and the next lookup tries to
dereference a NULL pointer.
Signed-off-by: Guido Guenther <agx@sigxcpu.org>
Christophe Varoqui [Thu, 7 Jun 2007 20:32:50 +0000 (22:32 +0200)]
[libmultipath] Remove libsysfs
libsysfs is deprecated and doesn't work with recent kernels.
Copied over stuff from udev and implemented our own sysfs handling.
Much saner now.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Guido Guenther <agx@sigxcpu.org>
Christophe Varoqui [Tue, 5 Jun 2007 23:21:28 +0000 (01:21 +0200)]
[libmultipath] lower libdevmapper version expectation to 1.02.08
In fact, I guess it could be lowered again since the Makefile
detects features available in the lib (no_flush for example).
Feel free to make me lower it again if needed.
Christophe Varoqui [Tue, 5 Jun 2007 23:17:54 +0000 (01:17 +0200)]
[libmultipath] scalability fix for devt2devname()
Move from the sysfs /block/*/dev nodes walking in search of maj:min
to a single file walking (/proc/partitions)
Based on idea and initial implementation from Hannes Reinecke, Suse.
Christophe Varoqui [Tue, 5 Jun 2007 21:50:20 +0000 (23:50 +0200)]
[udev] rules files for event proxying and kpartx split (2)
So that multipathd can use the udev-provided socket for event listening
and kpartx can have a truly independent udev setup (think dmraid without
multipath case).
Hannes Reinecke, Suse.
Christophe Varoqui [Mon, 4 Jun 2007 21:41:24 +0000 (23:41 +0200)]
[udev] rules files for event proxying and kpartx split
So that multipathd can use the udev-provided socket for event listening
and kpartx can have a truly independent udev setup (think dmraid without
multipath case).
Hannes Reinecke, Suse.
Christophe Varoqui [Mon, 4 Jun 2007 21:37:39 +0000 (23:37 +0200)]
[multipathd] Use udev socket as source of events instead of Netlink socket
When available. Keeps Netlink as a fallback.
Proper udev setup is required for this to work.
Patch to install such a setup follow.
Hannes Reinecke, Suse.
Christophe Varoqui [Mon, 4 Jun 2007 21:32:36 +0000 (23:32 +0200)]
[multipath] make install error on multipath.conf.5
multipath.conf.5 was not compressed in the install target of the Makefile.
Do that, and move the gzips in the prepare target to factorize a bit too.
Christophe Varoqui [Mon, 21 May 2007 22:24:22 +0000 (00:24 +0200)]
[libmultipath] new devmapper log handler needs stdarg.h
As it uses the va_list type.
Signed-off-by: Christophe Varoqui <christophe.varoqui@free.fr>
Hannes Reinecke [Mon, 21 May 2007 08:06:42 +0000 (10:06 +0200)]
[libmultipath] Fix pp_alua install target
The install target in the pp_alua Makefile should reference the
program, not the build target. Otherwise the program gets recompiled
on each install.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 16 May 2007 11:51:43 +0000 (13:51 +0200)]
[multipath] Add multipath.conf.5 manpage
We finally have a manpage for multipath.conf.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 16 May 2007 10:51:16 +0000 (12:51 +0200)]
[hwtable] Update entries for HP arrays
I finally figured out the different versions of HP storage
arrays. Thanks to Stephen Reilly of HP for this.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 16 May 2007 10:45:12 +0000 (12:45 +0200)]
[libmultipath] Add new priority checker mpath_hp_sw
All paths from a controller with HP Active/Standby firmware
should really be grouped according to their status; otherwise
the path switching will not work properly or you can use only
one path to that array.
This patch adds a new priority checker 'mpath_hp_sw' which
will allow these paths to be grouped accordingly.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 16 May 2007 10:41:02 +0000 (12:41 +0200)]
[hwtable] Update SGI entries
Add new entry for SGI Infinite Storage machines; and we should also
use the 'RDAC' path checker for SGI storage.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 16 May 2007 10:38:24 +0000 (12:38 +0200)]
[libmultipath] Fix typo on blacklist_exceptions handler
blacklist_exceptions_handler() has a typo which prevents the handler
from working.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 16 May 2007 10:37:11 +0000 (12:37 +0200)]
[hwtable] Update S/390 DASD entry
Current s390-tools contain a program 'dasdinfo', which should be used
instead of the older 'dasd_id' program from udev.
And we should be using 'queue_if_no_path', too.
Signed-off-by: Stefan Bader <bader@de.ibm.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 30 Apr 2007 07:26:28 +0000 (09:26 +0200)]
[multipathd] Fix handling of device-mapper devices
Device-mapper devices are available only after a 'change' event,
so it's quite pointless to check for the 'add' event.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 30 Apr 2007 07:23:46 +0000 (09:23 +0200)]
[libmultipath] Fix debugging output
Implement a proper output function for libdevmapper which ties
into our verbosity level. This allows us for a finer grained
control about the error messages from libdevmapper and we get
better debugging output to boot.
Signed-off-by: Stefan Bader <bader@de.ibm.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 16 May 2007 07:35:35 +0000 (09:35 +0200)]
[kpartx] Use mapname for device-mapper devices
When kpartx is run on a device-mapper device it makes more sense
to use the mapname for generating the device name, not the supplied
commandline arguments. This way we can run kpartx on '/dev/dm-X'
and still get sensible names.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 16 May 2007 07:31:47 +0000 (09:31 +0200)]
[libmultipath] Fix overflow in circular queue
Multipathd has a circular buffer where messages are stored prior to being
passed into the system logs. Under certain circumstances the circular buffer
fills up; and the intention appears to be that new messages are dropped until
space is freed in the buffer.
However sometimes the result of a full circular buffer is to overwrite the
earlier messages before they have been passed to the system buffer; resulting
in the loss of early messages and corruption of later messages.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 15 Mar 2007 08:24:15 +0000 (09:24 +0100)]
[libmultipath] Fixup EMC ALUA mode handling
Modern EMC machines support ALUA in addition to the vendor-specific
PNR (passive/not ready) method. Machines in ALUA mode will understand
PNR commands, too, so we only need to relax the check to operate
them correctly.
Signed-off-by: Ed Goggin <egoggin@vmware.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 30 Apr 2007 06:45:54 +0000 (08:45 +0200)]
[kpartx] fix install target
The install target should refer the executable, otherwise it'll trigger
an entire rebuild.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 20 Feb 2007 14:16:56 +0000 (15:16 +0100)]
kpartx: fix crash during boot
kpartx will crash during boot as device-mapper insists on freeing
all passed memory upon exit. So we don't have to do it.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Christophe Varoqui [Wed, 16 May 2007 21:17:02 +0000 (23:17 +0200)]
[libmultipath] the forgotten bit
Thanks Hannes, for reporting this forgotten changeset.
Christophe Varoqui [Sun, 6 May 2007 22:21:17 +0000 (00:21 +0200)]
[multipathd] add CLI readline completion
This one needed a bit of work :
o Add a convenient vector_foreach_slot_after() to the vector lib
o Move all add_handler() calls from main.c to cli.c, but don't set handlers
there. This way the multipathd binary execed as the CLI (-k flag) gains
the leisure the load the CLI dictionnary too. Which is quite useful for
keyword completion.
o Add a set_handler_callback() function and use it in main.c in place of
former add_handler() calls.
o No need to compute len each vector_foreach_slot() iteration in find_key()
o get_cmdvec() returns more precise failure hints as int return value.
The readline keyword generator needs those hints.
Christophe Varoqui [Thu, 3 May 2007 07:37:33 +0000 (09:37 +0200)]
[all] Path group timeout handling
The config file keyword is pg_timeout.
Takes value in seconds. Default is none.
Can be set in defaults, hardware or multipath configlets.
From Redhat resync.
Christophe Varoqui [Wed, 2 May 2007 13:58:41 +0000 (15:58 +0200)]
[build] detect presence of dm_task_no_flush symbol in libdevmapper
Fix this annoying build problem on system not yet implementing this API in
their libdevmapper package (ubuntu up to Feisty for example).
Christophe Varoqui [Wed, 2 May 2007 09:25:39 +0000 (11:25 +0200)]
[libmultipath] don't rely on PATH being set anymore for callouts
Redhat resync.
Christophe Varoqui [Wed, 2 May 2007 08:55:10 +0000 (10:55 +0200)]
[libmultipath] move from execvp to execv for callouts
From Redhat resync.
Christophe Varoqui [Wed, 2 May 2007 08:39:51 +0000 (10:39 +0200)]
[libmultipath] split long log msg about alias lookup on 2 lines
From Redhat branch resync.
Christophe Varoqui [Wed, 21 Mar 2007 22:10:33 +0000 (23:10 +0100)]
[libmultipath] Increase the wait time for device to appear in /dev
RDAC needs 60 sec timeout.
Chandra Seetharaman, IBM
Christophe Varoqui [Wed, 21 Mar 2007 22:08:43 +0000 (23:08 +0100)]
[libmultipath] ghost paths priorities are not set properly
Made some changes to honor the GHOST state while setting priorities.
Chandra Seetharaman, IBM
Christophe Varoqui [Wed, 21 Mar 2007 22:02:41 +0000 (23:02 +0100)]
[libcheckers] add new rdac checker
While working on lsi-rdac hardware handler, I found that the checkers "tur"
and "readsector0" are not serving the lsi-rdac properly. Also, the storage
device has a active/passive state which need to be handled properly.
So, I wrote a new path checker for lsi-rdac, to use the C4 inquiry page to
get the current owner of the lun and set the state as UP(active) or
GHOST(passive).
Chandra Seetharaman, IBM
Christophe Varoqui [Thu, 15 Feb 2007 23:59:52 +0000 (00:59 +0100)]
[libmultipath] blacklist logging overhaul
Make blacklist functions log as much info as possible.
o exported functions are now called filter_*
o each filter_* challenges exceptions list first, then blacklist if
necessary
o each filter_* is verbose
o each filter_* wraps a silent _filter_*
o filter_path chains _filter_*
o filter_* returns negative if exception list match
o filter_* returns positive if blacklist match
o update all blacklist_*() callers
o fix "show devices" CLI command to show whitelisted devs
Christophe Varoqui [Tue, 13 Feb 2007 22:50:25 +0000 (23:50 +0100)]
[libmultipath] remove another '\n' from alias.c logs
Christophe Varoqui [Tue, 13 Feb 2007 22:49:06 +0000 (23:49 +0100)]
[libmultipath] remove '\n' in binding match log
Christophe Varoqui [Wed, 7 Feb 2007 23:17:57 +0000 (00:17 +0100)]
[libmultipath] Changes hwtable.c to Support New Pillar
And new maintainer from Pillar Data.
Srinivas Ramani, Pillar Data
Christophe Varoqui [Fri, 26 Jan 2007 22:58:15 +0000 (23:58 +0100)]
[libmultipath] remove an unused variable in dict.c
Christophe Varoqui [Wed, 10 Jan 2007 22:06:09 +0000 (23:06 +0100)]
[libmultipath] Blacklist exception follow-ups
This patch adds the ability to have blacklist exceptions for vendor:product
devices. Also, the wwid and devnode exceptions weren't getting freed
properly in free_config, so that is fixed as well.
Benjamin E. Marzinski, RedHat
Christophe Varoqui [Sun, 7 Jan 2007 22:53:06 +0000 (23:53 +0100)]
[libmultipath] blacklist exceptions
On IBM System z we often have the problem that we have attached
several hundred devices. In case we want to use only a few of them
with mp-tools, we have to blacklist all others. For that reason I have
introduced a blacklist_exceptions keyword for the multipath.conf which
fills an internal exception list.
Additionally this patch adds two commands to the multipathd cli to
display blacklist rules and blacklisted devices.
A multipath.conf like:
------------------- snip --------------------
blacklist {
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z][[0-9]*]"
devnode "^cciss!c[0-9]d[0-9]*[p[0-9]*]"
devnode "^dasd[a-z]+[0-9]*"
}
blacklist_exceptions {
devnode "^dasd[c-d]+[0-9]*"
}
------------------- snap --------------------
All DASD devices are blacklisted except dasdc and
dasdd and corresponding partitions, which are listed in
the blacklist:exceptions section.
This example would produce the following output in the
"multipathd -k" cli:
------------------- snip --------------------
multipathd> show blacklist
device node rules:
- blacklist:
(config file rule) ^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*
(config file rule) ^hd[a-z][[0-9]*]
(config file rule) ^cciss!c[0-9]d[0-9]*[p[0-9]*]
(config file rule) ^dasd[a-z]+[0-9]*
(default rule) ^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*
(default rule) ^hd[a-z]
(default rule) ^cciss!c[0-9]d[0-9]*
- exceptions:
(config file rule) ^dasd[c-d]+[0-9]*
wwid rules:
- blacklist:
<empty>
- exceptions:
<empty>
device rules:
- blacklist:
(default rule) DGC:LUNZ
multipathd>
multipathd> show devices
available block devices:
dasda (blacklisted)
dasdb (blacklisted)
dasdc
dasdd
dm-0 (blacklisted)
dm-1 (blacklisted)
dm-2 (blacklisted)
dm-3 (blacklisted)
dm-4 (blacklisted)
dm-5 (blacklisted)
dm-6 (blacklisted)
loop0 (blacklisted)
loop1 (blacklisted)
loop2 (blacklisted)
loop3 (blacklisted)
loop4 (blacklisted)
loop5 (blacklisted)
loop6 (blacklisted)
loop7 (blacklisted)
ram0 (blacklisted)
ram10 (blacklisted)
ram11 (blacklisted)
ram12 (blacklisted)
ram13 (blacklisted)
ram14 (blacklisted)
ram15 (blacklisted)
ram1 (blacklisted)
ram2 (blacklisted)
ram3 (blacklisted)
ram4 (blacklisted)
ram5 (blacklisted)
ram6 (blacklisted)
ram7 (blacklisted)
ram8 (blacklisted)
ram9 (blacklisted)
sda
sdb
sdc
sdd
multipathd>
------------------- snap --------------------
Signed-off-by: Volker Sameske <sameske@de.ibm.com>
root [Mon, 11 Dec 2006 23:08:41 +0000 (00:08 +0100)]
[libmultipath] use noflush feature
The patch requires libdevmapper 1.02.11 or later.
The patch is tested on both multipath-tools on git and
multipath-tools-0.4.7-5.2 in RHEL5 beta2 for the following scenario:
1. prepare 2 physical paths
2. down (delete) the 1st path
3. create multipath map with the 2nd path with queue_if_no_path
4. do I/O on it
5. down (delete) the 2nd path
6. up the 1st path
7. no I/O error should be observed in user space
Jun'ichi Nomura, NEC
root [Mon, 11 Dec 2006 23:05:13 +0000 (00:05 +0100)]
[libmultipath] devmapper prereq detection overhault
o fix testing logic (1.2.0 now satisfies 1.1.1 prereq)
o add libdevmapper prereq testing
o split dm_prereq() in dm_libprereq() and dm_drvprereq()
o bring back min version settings in devmapper.c
o bump libdevmapper prereq to 1.02.11 (in preparation of no_flush use)
root [Mon, 11 Dec 2006 21:07:56 +0000 (22:07 +0100)]
[kpartx] fix partition calculations of DASD partitions
This patch fixes the offset and length calcuations for DASD partitions
with either CMS (without explicit offset), the old linux disk layout or
no partition information at all if the devices are using a blocksize
bigger than 512B.
In the cases mentioned above the offset was normalized (to the number of
512B sectors) twice and the size reduced by the normalized offset and
again by the double normalized offset later.
This leads to kpartx defining the wrong limits in these cases.
Signed-off-by: Stefan Bader <shbader@de.ibm.com>
Christophe Varoqui [Wed, 6 Dec 2006 22:22:07 +0000 (23:22 +0100)]
[multipath] correctness "multipath -ll" fix
follow-up
Edward Goggin, EMC
Christophe Varoqui [Mon, 27 Nov 2006 22:12:04 +0000 (23:12 +0100)]
[multipath] correctness "multipath -ll" fix
Just a simple change to multipath/main.c:update_paths()
to set the mpp field of each path so that the immediately
following call to pathinfo() will call get_state() on a
path with its mpp field set. This enables "multipath -ll"
to utilize the shared context field of the multipath struct.
Edward Goggin, EMC
Christophe Varoqui [Mon, 27 Nov 2006 22:06:36 +0000 (23:06 +0100)]
[libmultipath] fix user_friendly_names race
Without this patch I could fairly easily get two multipath mpath0 entries
in /var/lib/multipath/bindings by running 8 concurrent instances of
multipath(8) while with the patch I cannot get this problem to occur.
The posix file byte range locks used to provide atomicity for accessing the
entries in the multipath bindings file get released from whenever __any__
descriptor or FILE structure for that file is closed. This patch delays
the fclose() for the FILE structures used within lookup_binding() and
rlookup_binding() until there is no more need for the atomicity.
Edward Goggin, EMC
Christophe Varoqui [Mon, 27 Nov 2006 21:53:28 +0000 (22:53 +0100)]
[multipathd] man page update
Add CLI commands description.
Volker Sameske, IBM
Christophe Varoqui [Thu, 23 Nov 2006 23:26:43 +0000 (00:26 +0100)]
[libmultipath] tweak defaults for DDN S2A8500
When using multipath-tools 0.4.7, I would like to reports that DDN S2A8500
disk array reports a wrong status whith 'readsector0' checker. 'directio'
seems to be the right checker for such storage system.
Frederic Temporelli, Bull
Christophe Varoqui [Thu, 23 Nov 2006 23:06:23 +0000 (00:06 +0100)]
[checkers] handling CLARiiON I/O to inactive snapshot logical units
Prevent an I/O hang which can occur with host I/O to an inactive CLARiiON
snapshot logical unit. While the inactive snapshot LU is presented to a
host, inquiry, TUR, and read capacity commands succeed, but read and write
commands are failed. Complicating the matter is the fact that read/write
to the active paths fails with a particular sense code/asc/ascq combination
while read/write to the passive paths does not.
Edward Goggin, EMC
Christophe Varoqui [Thu, 23 Nov 2006 22:49:13 +0000 (23:49 +0100)]
[checkers] sg_read() enhancement
Retry SGIO 3 times max if we get a "Unit Attention" in sense data.
Edward Goggin, EMC
Christophe Varoqui [Thu, 23 Nov 2006 22:32:05 +0000 (23:32 +0100)]
[libchecker] move sg_read() to a new libsg.c
This function is bound to be shared among checkers.
So make it easy to do so.
Christophe Varoqui [Thu, 23 Nov 2006 21:52:35 +0000 (22:52 +0100)]
[checkers] multipath-wide shared context for checkers
At least one checker need to shared data between checkers attached to
all paths of a multipath.
This patch addresses this need by adding a "void * mpcontext" to
struct multipath, and its "void **" sibling in struct checker.
checker_init() ensures the multipath->mpcontext is attached to
*checker->mpcontext.
Checkers are in charge of allocating the memory block and attaching it
to *checker->mpcontext. the .init checker function is a natural
place for that.
Freeing the mpcontext in done in free_multipath().
Christophe Varoqui [Fri, 17 Nov 2006 21:04:04 +0000 (22:04 +0100)]
[defaults] Change of IBM DS8000 path grouping policy
Michael Loehr, IBM
Christophe Varoqui [Fri, 17 Nov 2006 20:33:30 +0000 (21:33 +0100)]
[libmultipath] braino, still get path prio for paths with PATH_DOWN
Edward Goggin, EMC
Christophe Varoqui [Wed, 15 Nov 2006 23:21:17 +0000 (00:21 +0100)]
[priority] adjust SCSI RTPG request buffer size in ALUA prioritizer
The following patch adds error and size checking to the REPORT TARGET
PORT GROUPS command issued by rtpg.c. The old code issued a buffer of
128 bytes, but never checked the return length. The new code starts
with a buffer of 128 bytes, but reallocates it if the buffer is too
small (SCSI returns the necessary length in the response data). This is
more robust as it handles devices that consume more than 128 bytes for
RTPG, like the Incipient NSP.
I tried to handle errors, etc. as closely as I could to what is already
there in the code. Let me know if you'd prefer anything written
differently.
Brian Geisel
Christophe Varoqui [Wed, 15 Nov 2006 23:06:48 +0000 (00:06 +0100)]
[libmultipath] clarify priority values
Define two values :
PRIO_UNDEF: prioritizer not exec yet, or returned an error
PRIO_DEFAULT: no prioritizer set, default value arbitrary set to 1
Changes :
1) 0 is no longer used as a possible priority value.
2) don't exec prioritizer in pathinfo() if path is down and priority is
defined
Edward Goggin, EMC
Dave Wysochanski, Red Hat
& Me
Christophe Varoqui [Tue, 14 Nov 2006 22:13:01 +0000 (23:13 +0100)]
[libcheckers] document checker states
Dave Wysochanski, Red Hat
Christophe Varoqui [Tue, 14 Nov 2006 21:26:38 +0000 (22:26 +0100)]
[libmultipath] scope limiting fixes
I messed up the patch a bit. Apparently dm_get_uuid() can
return a zero without actually having found a dm name which
matches the name parameter.
Also, I changed dm_get_uuid() so it either returns 1 or a null
string in the uuid return parameter -- in 2 different cases
it was doing neither.
The <dm_device_name> qualifier for the command line
"multipath -ll <dm device name>" can now accept up
to 3 different names for the same dm mapped device,
that is, a user friendly name, an alias in
/etc/multipath.conf, and the current name as
reported by "dmsetup ls".
Edward Goggin, EMC
Christophe Varoqui [Mon, 13 Nov 2006 22:55:20 +0000 (23:55 +0100)]
[libmultipath] configure() scope-limiting corner case
This patch enables "multipath -l <dm device name>"
to work if the current dm_alias has been changed by
"dmsetup rename" or other means.
Edward Goggin, EMC
Christophe Varoqui [Sat, 11 Nov 2006 14:04:59 +0000 (15:04 +0100)]
[libcheckers]
Change to libcheckers/readsector0.c to allow other checkers than
readsector0 to use sg_read().
Also provide the sense info in a buffer supplied by caller.
Edward Goggin, EMC
Christophe Varoqui [Sat, 11 Nov 2006 13:57:55 +0000 (14:57 +0100)]
[libmultipath] pathinfo() to invoke the path priority callout
Changed libmultipath/discovery.c to allow pathinfo() to invoke the path
priority callout function of a path with a path state of PATH_DOWN since
some paths (e.g., paths to inactive snapshot LU on CLARiiON) may have
their state set to PATH_DOWN for reasons other than transport
connectivity failure.
Without this change, it is possible to create a situation whereby there
are paths of different priorities in the same path group even though the
path group policy is priority based grouping. This is certainly the
case for paths to a multipath mapped device for an inactive snapshot
CLARiiON LUs when the paths change to a healthy state as soon as the
snapshot is activated.
Edward Goggin, EMC
Christophe Varoqui [Thu, 9 Nov 2006 21:17:13 +0000 (22:17 +0100)]
[libmultipath] remove dup_hwe()
Deprecated by recently introduced find_hwe_strmatch().
Christophe Varoqui [Thu, 9 Nov 2006 21:16:00 +0000 (22:16 +0100)]
[libmultipath] RR_WEIGHT_PRIORITIES undefined
Yet. So don't use it in the recently introduced HSV2.* defaults.
Christophe Varoqui [Thu, 9 Nov 2006 21:07:41 +0000 (22:07 +0100)]
[libmultipath] Update HP HSV200 hardware table
According to HP the behaviour of the HSV200 depends on the software
release; all revisions smaller or equal to '3000' have active/passive
support; all revisions above that have active/active support.
Translated it means that the older firmware uses the HP-style
'START_STOP_UNIT' command to switch paths, while the newer firmware
supports ALUA.
So we should update the hardware tables accordingly.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Christophe Varoqui [Thu, 9 Nov 2006 21:06:05 +0000 (22:06 +0100)]
[libmultipath] Add support for matching against revision field
The standard SCSI inquiry data provides for a field 'revision' which
specifies the software revision of the device. Some vendors changed
the behaviour during software releases so it's desireable that we
can match on that field in the hardware table, too.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Christophe Varoqui [Thu, 9 Nov 2006 21:02:46 +0000 (22:02 +0100)]
[libmultipath] Use strmatch to load config file
Currently we're using regexec to load the initial hardware table.
Unfortunately the hardware table has regex as defaults, so it's quite
possible for two different regular expressions do match.
But that's quite undesired as we just want a clean 1:1 copy here.
So we're better using a string match for comparison.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Christophe Varoqui [Wed, 8 Nov 2006 21:47:37 +0000 (22:47 +0100)]
[libmultipath] multipath devices are not created for the Luns having 8 paths
When setting the rr_weight to 'priorities' multipath fails to
setup a device-mapper table. This is due to a missing initialization
of the minio field, which will be multiplied by the path priority
for each path. This results in an eventual overflow of the minio
field and an invalid device mapper table.
References: 203823
Signed-off-by: Hannes Reinecke <hare@suse.de>
Christophe Varoqui [Thu, 19 Oct 2006 20:24:58 +0000 (22:24 +0200)]
[multipath] add '-h' option
Calling 'multipath -h' always added the line 'Unknown switch: (null)' in
front of the usage text since '-h' was not defined.
This patch just adds the '-h' option.
Volker Sameske, IBM
Christophe Varoqui [Tue, 26 Sep 2006 21:21:24 +0000 (23:21 +0200)]
[prio] ALUA prioritizer broken for paths with high minor
Here's a patch which I think will allow mpath_prio_alua to
work better with device files with minor numbers >= 256.
Edward Goggin, EMC
Christophe Varoqui [Mon, 4 Sep 2006 19:33:37 +0000 (21:33 +0200)]
[libmultipath] remove some more absolute path in hwtable
Hannes sent a patch to remove one for IBM 3526.
Go a bit further, removing all absolute paths.
Christophe Varoqui [Sun, 3 Sep 2006 22:33:08 +0000 (00:33 +0200)]
[multipath] disabling lock_fs call on DM_DEVICE_RESUME libdevmapper ioctl
This patch to dm_simplecmd of multipath-tools/libmultipath/devmapper.c will
disable the use of lock_fs during I/O suspension while changing
dm-multipath
device mapper maps via the DM_DEVICE_RESUME ioctl of libdevmapper.
Disabling lock_fs will result in not flushing I/O to the dm-multipath block
device before changing the maps for the mapped device. Flushing I/O at
this
time appears not only unnecessary for dm-multipath devices but causes some
troublesome delays due to SCSI HBA driver target-side timeouts when these
maps are changed as a result of paths coming and going while upgrading
software (a non-disruptive ucode upgrade) on a storage system.
As is the case for any change which is dependent on similar changes in
libdevmapper and the kernel, this patch will introduce a dependency on
libdevmapper and kernel. Not sure which versions first had this support
but
at least libdevmapper 1.02.02 and linux kernel version 2.6.18-rc2 have the
required support.
Edward Goggin, EMC
Christophe Varoqui [Sun, 3 Sep 2006 22:15:44 +0000 (00:15 +0200)]
[multipath] Fixup return code for 'multipath -l'
'multipath -l' should really set the return code to '0' if no error
occurred.
Hannes Reinecke, Suse
Christophe Varoqui [Sun, 3 Sep 2006 22:14:54 +0000 (00:14 +0200)]
[multipath] remove obsolete '-D' option
our documentation folks complained that the manpage documents an
obsolete / unused '-D' option for multipath.
This patch removes this description from the manpage.
Hannes Reinecke, Suse
Christophe Varoqui [Sun, 3 Sep 2006 22:13:54 +0000 (00:13 +0200)]
[libmultipath] Fixup hwtable regexp
appearently no-one noticed that we've switched to regular expressions
instead of shell-style fnmatch for the hwtable.
Quite surprisingly, really, that no-one complained; the change has been
done in October 2005.
Anyway, this patch cleans it up. And also splits off the IBM DS6000 and
IBM SVC, as they are separate machines.
Hannes Reinecke, Suse
Christophe Varoqui [Sun, 3 Sep 2006 22:12:53 +0000 (00:12 +0200)]
[priority] disable debug output for pp_tpc
this patch removes the debug output for pp_tpc and also decreases the
priority ratings so that the passive path will have a priority of 0.
Hannes Reinecke, Suse
Christophe Varoqui [Sun, 3 Sep 2006 22:11:39 +0000 (00:11 +0200)]
[libmultipath] add support for IBM 3526
we've found another IBM storage server in our lab; this patch adds the
necessary hwtable entry for it.
However, this is an RDAC machine, so it'll work only in some cases. One
day we really need an RDAC hw-handler.
Hannes Reinecke, Suse
Christophe Varoqui [Sat, 12 Aug 2006 14:30:31 +0000 (16:30 +0200)]
[checkers] EMC checker to report LUNZ as failing (2)
Fix braino while applying patch.
Christophe Varoqui [Fri, 11 Aug 2006 06:45:29 +0000 (08:45 +0200)]
[checkers] EMC checker to report LUNZ as failing
This patch simply reports a PATH_DOWN status for paths to an EMC CLARiiON
LUNZ (or an unbound) block device since these paths cannot possibly be used
to issue I/O to such a device. In fact, allowing block I/O to a LUNZ
dm-multipath device will cause the process to hang until the no_path_retry
timeout is incurred. This is not desirable.
Ed Goggin, EMC
Christophe Varoqui [Wed, 19 Jul 2006 12:49:34 +0000 (14:49 +0200)]
[libmultipath] make sure to terminate strftime buff properly
Bernhard Fischer
Christophe Varoqui [Wed, 19 Jul 2006 12:44:20 +0000 (14:44 +0200)]
[libmultipath] allow for non-default DESTDIR in hwtable
Bernhard Fischer