summaryrefslogtreecommitdiff
path: root/multipathd
AgeCommit message (Collapse)AuthorFilesLines
2008-05-21add '-r' option to force devmap reloadChristophe Varoqui1-2/+2
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.
2008-04-30Fixup MakefilesHannes Reinecke1-1/+1
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>
2008-04-30Remove DAEMON definesHannes Reinecke2-1/+3
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>
2008-04-30Make modules directory configurableHannes Reinecke1-2/+3
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>
2008-04-30libdevmapper prints garbage on shutdownHannes Reinecke1-2/+8
This patch fixes 2 logging bugs: o multipath command prints unexpected log message like "libdevmapper: libdm-common.c(303): Created /dev/mapper/<mapname>" o multipathd doesn't log messages like "--------shut down------" during the exit path What is the problem: o multipath command and multipathd register dm_write_log() using dm_log_init() and it can be called from libdevmapper codes like dm_lib_release(). o dm_write_log() references the global "conf" to find the verbosity, but it is freed before dm_lib_release() calls dm_write_log(). o So dm_write_log() reads garbage value like big vervosity. What does the patch do: o multipath command sets NULL to "conf" after freeing it. This prevents dm_write_log() from reading garbage data. o multipath command and multipathd free "conf" after all logging are completed, because the logging functions reference it to find the verbosity. Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Hannes Reinecke <hare@suse.de>
2008-04-12[checkers] checkers are now dlopen'ed pluginsChristophe Varoqui2-3/+6
just like prioritizers. A lot of files shuffling too.
2008-04-08[lib] merge libprio in libmultipathChristophe Varoqui2-4/+3
There is actually just the prio plugins api files linked into libmultipath.so Prioritizers proper go under libmultipath/prioritizers
2008-04-04Move to a shared lib model forChristophe Varoqui2-37/+26
1) checkers (one lib for all checkers for a start) 2) prioritizers (one helper lib, plus one lib per prioritizer) 3) libmultipath Collaterals include : o Remove old prioritizer callouts. o Drop the klibc support o Add remove_map(s)/remove_map(s)_and_stop_waiter(s) helpers Regression testing is needed now.
2008-01-15[libmultipath] fix the "too many files" errorBenjamin Marzinski1-0/+17
Added a max_fds parameter to /etc/multipath.conf. This allows you to set the maximum number of open fds that multipathd can use, like with ulimit -n. Also added some code so that multipath closes the file descriptor after it's used by the checker function, since multipath doesn't need to keep them always open like multipathd does.
2007-11-19[libprio] initial commitChristophe Varoqui1-0/+4
Priority callouts are nice, but have drawbacks. 1) multipathd holds a fd per path, but callouts have to open another for themselves. Which may fail. 2) callouts stored on a multipahed filesystem may hang multipathed on paging operation when there are no active path for the hosting device (getprio is in the salvation codepath). The window is small but Netapp fault injection tool manage to triggers the bug reliably. This patch merges to priority methods in multipathd.
2007-11-10[libmultipath] blacklist exceptions issuesChristophe Varoqui1-2/+2
the current situation is fishy. Ben pointed a true braino in the code I introduced when restructuring the blacklist lib : in _filter_path(), I test each _filter_*() for r!=0 , where I intented to check for r>0. r==0 implements : "exit on first blacklist or exception match". r>0 implements : "exit on first blacklist match". With this later behaviour I can set things like that for max safety and efficiency : blacklist { devnode .* device { vendor .* product .* } wwid .* } blacklist_exceptions { devnode sd.* device { vendor IET.* product .* } wwid "1646561646265.*" } or pragmatically : blacklist { devnode .* wwid .* } blacklist_exceptions { devnode sd.* wwid "1646561646265.*" } Working that out, I also realized there may be another small misbehaviour : First, a little background on path discovery operations : 1) /sys/block parsing shows devnode names 2) devnode names examination shows device identification strings 3) these strings help us choose a getuid helper, which finally shows wwids Meaning we want the devnode blacklisting to prevail over device and wwid, in case we know we don't have device strings available (loop, dm-, raw, ...) Similarily, we want the device blacklist to prevail over wwid, in case we know we don't have getuid callout available. I have no example for this case though, so it shouldn't be as important as the previous one. Problem is we challenge _filter_device() after _filter_wwid(). This can be easily shufled around.
2007-08-11[multipathd] extract a spaghetto from checkerloop()Christophe Varoqui1-133/+141
Code reorg only.
2007-08-11[multipathd] fail/reinstate CLI commands disable/enable path checkerChristophe Varoqui1-1/+9
The "fail path X" CLI command was an interesting debug tool, showing the checkers automatically reinstating the failed path. But some fun spoilers want to use the thing to prepare cable unplugs and other maintenance ops. So make the command also care about diabling and enabling the checker to inhibit auto-reinstates.
2007-08-02[multipathd] Add SuSE init scriptHannes Reinecke1-0/+132
2007-07-25[multipathd] remove sysfs devices from cacheHannes Reinecke1-1/+7
Whenever a device is really removed from any multipath map we should also remove it from the cache. Otherwise we'll induce a memory leak.
2007-07-24[multipathd] whitespace cleanupHannes Reinecke1-40/+40
multipathd/main.c has quite some 'interesting' whitespace usage. Better stick to established coding rules.
2007-06-19Ease installation of unstripped binariesGuido Guenther1-1/+1
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>
2007-06-19[libchecker] restore synchronous checker operation to async-capable checkersChristophe Varoqui1-1/+6
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.
2007-06-15[libcheckers] async path checking in the frameworkChristophe Varoqui1-1/+8
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.
2007-06-12[libcheckers] use async I/O for directio checkerHannes Reinecke1-1/+1
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>
2007-06-09[multipathd] Fix segfault on disappearing pathsChristophe Varoqui1-0/+3
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>
2007-06-07[libmultipath] Remove libsysfsChristophe Varoqui4-53/+60
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>
2007-05-21[multipathd] Fix handling of device-mapper devicesHannes Reinecke1-2/+4
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>
2007-05-21[libmultipath] Fix debugging outputHannes Reinecke1-0/+3
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>
2007-05-07[multipathd] add CLI readline completionChristophe Varoqui4-56/+225
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.
2007-02-16[libmultipath] blacklist logging overhaulChristophe Varoqui2-10/+7
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
2007-01-07[libmultipath] blacklist exceptionsChristophe Varoqui6-3/+101
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>
2006-11-27[multipathd] man page updateChristophe Varoqui1-6/+80
Add CLI commands description. Volker Sameske, IBM
2006-07-19[multipathd] sweetsChristophe Varoqui1-10/+12
- vector_foreach_slot takes an unsigned i - don't use old-style initializer for setscheduler's sched_param Bernhard Fischer
2006-07-19[man] update date of manpagesChristophe Varoqui1-3/+3
Bernhard Fischer
2006-06-22[multipathd] get the layout right with "sho topo" CLI commandsChristophe Varoqui1-2/+4
2006-03-31[multipathd] some more output coherencyChristophe Varoqui1-2/+2
2006-03-31[multipathd] plug a small leak on "reconfigure" CLI commandChristophe Varoqui1-16/+4
2006-03-27[multipathd] don't set the SIGKILL signalChristophe Varoqui1-1/+0
Valgrind told me it was useless.
2006-03-16[multipathd] ignore SIGPIPEChristophe Varoqui1-0/+1
Maxim Kozover reported daemon segfault when breaking the recieving side of the unix socket. Credits.
2006-03-15[libmultipath] a bit of code reorganisationChristophe Varoqui1-333/+4
o locking primitives moved to libmultipath/lock.[ch] o waiter threads control primitives moved to libmultipath/waiter.[ch] o update_multipath() and queue_mode_{add,del}_path() moved to libmultipath/structs_vec.c
2006-03-14[libmultipath] move the tools' version string to the libChristophe Varoqui1-0/+3
o Remove multipath/main.h o Print the version string in the CLI syntax reference
2006-03-12[multipathd] add more checkers message printing upon path failuresChristophe Varoqui1-1/+3
Edward Goggin, EMC
2006-03-02[multipathd] ev_add_map should return ok for spurious eventsChristophe Varoqui1-6/+4
Benjamin Marzinski, Redhat
2006-02-21[multipathd] syncing path statesChristophe Varoqui1-0/+40
Occasionally, the path states for multipathd and device mapper are out of sync. This happens either when multipathd starts, or after a multipath map is created or reloaded (what a path is added or removed, or a map is added). The attached patch syncs the paths' dmstate with it's state after one of these actions happens. Benjamin Marzinski, Redhat
2006-02-18[multipathd] nr_active inc/dec losts or overzealousChristophe Varoqui1-7/+21
There is some weirdness in the nr_active handling in multipathd, For instance, whenever you change state to a PATH_DOWN or PATH_SHAKY state, you decrement the number of active paths, even if you change from PATH_DOWN to PATH_SHAKY. This patch attempts to fix the problem. It slightly changes how some of the states are handled.
2006-02-17[multipathd] due failback not happeningChristophe Varoqui1-1/+2
If the failback period is set to more that four times the polling interval, paths will never fail back. This is because the failback_tick keeps getting reset. The attached patch fixes this. Benjamin Marzinski, Redhat
2006-02-17[multipathd] blacklisting and blacklist changes ignored on spotsChristophe Varoqui2-7/+28
multipathd doesn't correctly blacklist devices by wwid, because the blacklist check happens before the device information is known. This patch fixes that. Benjamin Marzinski, Redhat
2006-02-13[checkers] API rewriteChristophe Varoqui3-18/+11
The context handling and the layering were poor, so rewrite. The users now need to : - alloc a "struct checker" - select a checker by name : checker_lookup() - init own checker instance : checker_get() - set the path file descriptor to check : checker_set_fd() - use : checker_check() - release : checker_put() Checkers now are asked to provide 3 functions : - foo_init : alloc and initialize the checker context - foo_free : free the context - foo : the checking function proper These 3 are registered in a static checkers array, along with the checker name. Lookups are based on checker name. The users are all updated : - checker_get is folded into path (re)discovery - checker_put is folded into path free/orphan Additional gains : - directio is updated to use a context to avoid computations upon each check - checkers code is leaner Please test and report.
2006-01-20[libmultipath] "show conf" CLI command to output the blacklist tooChristophe Varoqui1-0/+6
All multipath.conf keywords and sections are now covered by "show conf".
2006-01-20[libmultipath] move apply_format() from discovery.c to callout.cChristophe Varoqui1-1/+1
2006-01-20[libmultipath] more path: and multipath: output prefixingChristophe Varoqui1-3/+0
2006-01-20[libmultipath] add "map:" prefix to propsel functions outputChristophe Varoqui1-1/+0
2006-01-18[libmultipath] add device blacklistingChristophe Varoqui2-3/+9
Syntax is : devnode_blacklist { devnode sr* wwid 6005* device { vendor DEC product * } }
2006-01-17[multipathd] "show topo" as a "show maps topo" aliasChristophe Varoqui1-0/+1