Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
just like prioritizers.
A lot of files shuffling too.
|
|
There is actually just the prio plugins api files linked into libmultipath.so
Prioritizers proper go under libmultipath/prioritizers
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Code reorg only.
|
|
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.
|
|
|
|
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.
|
|
multipathd/main.c has quite some 'interesting' whitespace usage.
Better stick to established coding rules.
|
|
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>
|
|
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.
|
|
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.
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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.
|
|
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
|
|
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>
|
|
Add CLI commands description.
Volker Sameske, IBM
|
|
- vector_foreach_slot takes an unsigned i
- don't use old-style initializer for setscheduler's sched_param
Bernhard Fischer
|
|
Bernhard Fischer
|
|
|
|
|
|
|
|
Valgrind told me it was useless.
|
|
Maxim Kozover reported daemon segfault when breaking the recieving side
of the unix socket. Credits.
|
|
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
|
|
o Remove multipath/main.h
o Print the version string in the CLI syntax reference
|
|
Edward Goggin, EMC
|
|
Benjamin Marzinski, Redhat
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
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.
|
|
All multipath.conf keywords and sections are now covered by "show conf".
|
|
|
|
|
|
|
|
Syntax is :
devnode_blacklist {
devnode sr*
wwid 6005*
device {
vendor DEC
product *
}
}
|
|
|