platform/upstream/multipath-tools.git
18 years ago[libmultipath] print tweaks++
Christophe Varoqui [Tue, 25 Oct 2005 13:44:49 +0000 (15:44 +0200)]
[libmultipath] print tweaks++

Introduce a PRINT_PROGRESS macro.
Factorize use in snprint_{path,map}

18 years ago[libmultipath] printing tweaking
Christophe Varoqui [Tue, 25 Oct 2005 13:29:09 +0000 (15:29 +0200)]
[libmultipath] printing tweaking

- unchecked prio reported as '#'
- unchecked dm path state reported as '[undef]'
- priority heading is know called 'pri' instead of 'prio'
  (coherent with tools like ps, top, etc ...)

18 years ago[all] User friendly names patch
Christophe Varoqui [Tue, 25 Oct 2005 13:22:12 +0000 (15:22 +0200)]
[all] User friendly names patch

This is a patch to add the option of more user friendly names for the
multipath maps, in the form of mpath<n>.  It adds a configuration option
"user_friendly_names". If set, it will cause multipath to check a bindings
file for the names. The bindings file (/var/lib/multipath/bindings) has
alias to wwid mappings. If multipath finds its wwid in the file, it uses
the associated alias. If not, it creates a new alias, and adds the binding
to the bindings file. If the config option is not set, multipath defaults
to it's regular behavior. Specific aliases in /etc/multipath.conf override
this behavior.

Benjamin Marzinski, Redhat

18 years ago[libmultipath] printing enhancements and fixes
Christophe Varoqui [Mon, 24 Oct 2005 13:35:54 +0000 (15:35 +0200)]
[libmultipath] printing enhancements and fixes

- [enh] align path uuid
- [fix] PAD() macro could overflow
- [enh] add line header for paths (print.c:snprint_path_header)
- [enh] align pathvec dumps in 'multipath -v3' and print header
- [enh] remove heading and trailing white line in multipathd cli output
- [enh] print header in cli's 'show paths' mode

18 years ago[libmultipath] handle no_path_retry keyword in hardware entries
Christophe Varoqui [Mon, 24 Oct 2005 08:09:03 +0000 (10:09 +0200)]
[libmultipath] handle no_path_retry keyword in hardware entries

Now this keyword can be set in the default, multipath and device
config blocks.

18 years ago[multipath] claimed path handling overall
Christophe Varoqui [Sun, 23 Oct 2005 20:51:40 +0000 (22:51 +0200)]
[multipath] claimed path handling overall

Detecting path claims during the discovery, and all paths, exposes
us to open(..., O_EXCL) collisions. Paths could appear as claimed when
they are not actually.

Visible effect is, during a udev add storm (driver loading), rarely,
a map would not appear when it should have. This was reported by
Maxim Kozover.

This patch remove all pp->claimed usage and allows DM_DEVICE_CREATE to
fail when loading a map with claimed paths (with libdevmapper logging
shut). But cleanup the mess on error.

18 years ago[libmultipath] message when a map can't be flush because in use
Christophe Varoqui [Sun, 23 Oct 2005 18:51:47 +0000 (20:51 +0200)]
[libmultipath] message when a map can't be flush because in use

18 years ago[multipath] Fix -F appearing twice in the multipath -h output
Christophe Varoqui [Fri, 21 Oct 2005 09:49:19 +0000 (11:49 +0200)]
[multipath] Fix -F appearing twice in the multipath -h output

multipath -h shows 2 options using "-F", where only one of them should be using
-F and another -f. Redhat Bugzilla #171366.

B. Nocera, Redhat

18 years ago[libmultipath] some more snprint_path() beautifying
Christophe Varoqui [Thu, 20 Oct 2005 21:27:12 +0000 (23:27 +0200)]
[libmultipath] some more snprint_path() beautifying

- align priority values (too bad log10 needs -lm build flag)
- remove a redundant trailing whitespace after #:#:#:#
- pad states
- scale completion bar to 10 chars

18 years ago[kpartx] partition type check was flawed
Christophe Varoqui [Thu, 20 Oct 2005 13:28:45 +0000 (15:28 +0200)]
[kpartx] partition type check was flawed

Lars Soltau, IBM

18 years ago[config] rr_min_io typo fix
Christophe Varoqui [Thu, 20 Oct 2005 13:24:05 +0000 (15:24 +0200)]
[config] rr_min_io typo fix

Should closes RH Bugzilla #171286

18 years ago[multipath] proper execution serializing
Christophe Varoqui [Wed, 19 Oct 2005 13:12:52 +0000 (15:12 +0200)]
[multipath] proper execution serializing

Multiple multipath(8) execs can race with udev storm.

We can simulate this with the following :
"multipath -F; /sbin/multipath 8:16 & /sbin/multipath 8:32"

Problem arise when two runs are about to create the same map.
One will fail, leaving us with a choice : abord or retry.

This patch implements the retry policy, as we have no way to tell
if the race winner was the one with outdated info or not.

Also :
- beautifies main.c:select_action() messages.
- isolate a nice configure_multipath() entry point fonction out of main()

18 years ago[multipath] drop a notice upon wwid change causing a map remove/create
Christophe Varoqui [Wed, 19 Oct 2005 08:29:53 +0000 (10:29 +0200)]
[multipath] drop a notice upon wwid change causing a map remove/create

18 years ago[multipath] fix a double free error
Christophe Varoqui [Tue, 18 Oct 2005 10:01:02 +0000 (12:01 +0200)]
[multipath] fix a double free error

"multipath $FLAGS $ALIAS" code path lead to a double free :
1) get_refwwid did a lookup in mptable and returned mpe->alias as the
   refwwid
2) in the exit path, we freed refwwid
3) then free_config()->free_mptable()->free_mpe() freed mpe->alias at the
   same address

So return strdup(mpe->alias) instead.

18 years ago[multipathd] diff friendly / cosmetic cli command defines
Christophe Varoqui [Tue, 18 Oct 2005 09:28:44 +0000 (11:28 +0200)]
[multipathd] diff friendly / cosmetic cli command defines

18 years ago[priority] remove pp_random shellism
Christophe Varoqui [Tue, 18 Oct 2005 08:52:37 +0000 (10:52 +0200)]
[priority] remove pp_random shellism

18 years ago[build] strip at install time, not build time anymore
Christophe Varoqui [Tue, 18 Oct 2005 08:12:16 +0000 (10:12 +0200)]
[build] strip at install time, not build time anymore

So that we can 'gdb $BUILD_DIR/.../$EXEC'

18 years ago[multipathd] multipathd segfault fix in main.c:update_queue_mode_del_path()
Christophe Varoqui [Mon, 17 Oct 2005 14:43:00 +0000 (16:43 +0200)]
[multipathd] multipathd segfault fix in main.c:update_queue_mode_del_path()

Dereferencing mpp->pg->pp->mpp is not that smart.
Use mpp directly here.

May be main.c:update_queue_mode_del_path() should check mpp rather than
faulting ... Kiyoshi Ueda ?

18 years ago[libmultipath] mostly cosmetic
Christophe Varoqui [Mon, 17 Oct 2005 13:23:40 +0000 (15:23 +0200)]
[libmultipath] mostly cosmetic

1) harden discovery.c:path_discovery() sysfs loop
2) remove redundant check in discovery.c:apply_format()

18 years ago[multipathd] braino fixes
Christophe Varoqui [Mon, 17 Oct 2005 13:21:38 +0000 (15:21 +0200)]
[multipathd] braino fixes

1) revoke more info upon path orphaning
2) dump_pathvec() to return negative value when reply is empty
3) ux_trigger() not to append a "ok" when handler return value is < 0

1) fixes an occasional daemon segfault when cycling add/remove paths
2+3) makes for multipath not receiving "ok" as a cached pathvec :)

18 years ago[multipath] fix segfault upon '-ll' with empty map present
Christophe Varoqui [Fri, 14 Oct 2005 15:26:11 +0000 (17:26 +0200)]
[multipath] fix segfault upon '-ll' with empty map present

Noted by Maxim Kozover, regression testing squad

18 years ago[libmultipath] fix empty map flushing
Christophe Varoqui [Fri, 14 Oct 2005 15:17:02 +0000 (17:17 +0200)]
[libmultipath] fix empty map flushing

devmapper.c:dm_flush_map() should flush empty map, whatever the type the
caller asked it to limit to.

Noted by Maxim Kozover

18 years ago[multipath] '-l' should not print empty maps
Christophe Varoqui [Fri, 14 Oct 2005 15:12:50 +0000 (17:12 +0200)]
[multipath] '-l' should not print empty maps

Noted by Maxim "QA" Kozover :)

18 years ago[multipathd] invalidate path dmstate when orphaning
Christophe Varoqui [Fri, 14 Oct 2005 14:23:37 +0000 (16:23 +0200)]
[multipathd] invalidate path dmstate when orphaning

18 years ago[multipathd] close orphan path file descriptors
Christophe Varoqui [Fri, 14 Oct 2005 08:45:36 +0000 (10:45 +0200)]
[multipathd] close orphan path file descriptors

Maxim Kozover rightly reported :

"multipathd keeps the file /dev/sdx open, regardless if there's a
multipath-related map having that sdx device as a path or not.
It drops /dev/sdx only if the sdx device is removed.
What's bad is that this drop is not always successful and I think it's
not a right way to cope with the situation. Killing multipathd always
releases the descriptors.

Now when I (...) remove maps with multipath -f, the number of
multipathd threads changes accordingly. But it doesn't release
/dev/sdx devices. That means even after I did multipath -f for all
iSCSI devices and multipath -l output is empty, multipathd still has
those /dev/sdx files open and I can't unload iSCSI driver, cause it
has a non-zero usage count."

18 years ago[multipathd] retry_tick initialization/update fixes
Christophe Varoqui [Thu, 13 Oct 2005 08:21:54 +0000 (10:21 +0200)]
[multipathd] retry_tick initialization/update fixes

Fix some bugs of missing retry_tick initialization/update in multipathd.
o Initialization by wrong value in update_queue_mode_del_path.
o Missing status update in update_multipath for events from kernel.
o Missing re-initialization in reconfigure.

Kiyoshi Ueda, NEC

18 years ago[multipath] Extension of the "no_path_retry" scope to the multipath
Christophe Varoqui [Thu, 13 Oct 2005 08:20:21 +0000 (10:20 +0200)]
[multipath] Extension of the "no_path_retry" scope to the multipath

Kiyoshi Ueda, NEC

18 years ago[multipathd] fix off-by-1sec path check interval
Christophe Varoqui [Thu, 13 Oct 2005 08:07:44 +0000 (10:07 +0200)]
[multipathd] fix off-by-1sec path check interval

Current path check interval is 1 second longer than polling_interval
setting in multipath.conf.

This bug affects the "no_path_retry" option.
For example, if no_path_retry is set in 1, retry (== path check) will
not be launched in no-path situation.

18 years ago[mutipathd] fix off-by-1sec defered failback
Christophe Varoqui [Thu, 13 Oct 2005 08:06:26 +0000 (10:06 +0200)]
[mutipathd] fix off-by-1sec defered failback

Current delay time of defered failback is 1 second shorter than
"failback" setting in multipath.conf, because defered_failback_tick()
is called before sleep(1) in checkerloop().

Kiyoshi Ueda, NEC

18 years ago[multipath] "skip out of scope map" fix
Christophe Varoqui [Wed, 12 Oct 2005 14:24:18 +0000 (16:24 +0200)]
[multipath] "skip out of scope map" fix

The logic was accidentaly inverted in the last patch.
And now we drop the map from mpvec when "out of scope".

18 years ago[multipath] overzealous deadmap detection fix
Christophe Varoqui [Tue, 11 Oct 2005 10:36:45 +0000 (12:36 +0200)]
[multipath] overzealous deadmap detection fix

18 years ago[multipath] consider the presence of conflicting empty maps
Christophe Varoqui [Mon, 10 Oct 2005 13:28:15 +0000 (15:28 +0200)]
[multipath] consider the presence of conflicting empty maps

Drop the conflicting map, then create the new one.
The daemon catchs up through its uevent handlers.

18 years ago[config] undocument the feature keyword
Christophe Varoqui [Sat, 8 Oct 2005 09:58:06 +0000 (11:58 +0200)]
[config] undocument the feature keyword

Replaced by no_path_retry.

18 years ago[libmultipath] deprecate the default_foo config file options
Christophe Varoqui [Sat, 8 Oct 2005 09:53:31 +0000 (11:53 +0200)]
[libmultipath] deprecate the default_foo config file options

These are in the default{} configlet; the prefix was clearly redundant.
Keep the old keyword around for a smooth transition, but undocument them.

18 years ago[multipathd] switch on/off the queueing feature when oportune
Christophe Varoqui [Fri, 7 Oct 2005 22:45:55 +0000 (00:45 +0200)]
[multipathd] switch on/off the queueing feature when oportune

The following patch adds time-based retry feature in no-path situation
to multipathd.  Any comments are welcome.

This patch adds 'no_path_retry' option to multipathd.

o no_path_retry = "fail" is equal to 'fail_if_no_path'.
  (i.e. I/O to the no-path map will immediately fail.)

o no_path_retry = "queue" is equal to 'queue_if_no_path'.
  (i.e. I/O to the no-path map will be queued until any path comes up.)

o If no_path_retry = <n> where n is positive number,
  then multipathd will set queue_if_no_path to the map,
  and if the all paths are down, multipathd will turn the feature
  off to fail_if_no_path after the checker tries <n> times for each
  paths in the map.

Multipathd re-writes queue_if_no_path feature parameter in the map,
if this option is specified.  But by default, this patch doesn't
change current multipathd behaviour.
So this patch don't break any existing configuration.

Kiyoshi Ueda, NEC

18 years ago[multipath] remove uneeded map resume upon reload
Christophe Varoqui [Fri, 7 Oct 2005 09:27:02 +0000 (11:27 +0200)]
[multipath] remove uneeded map resume upon reload

This sliped in recently.

18 years ago[libmultipath] specify vendor/product as regular expressions
Christophe Varoqui [Wed, 5 Oct 2005 10:56:42 +0000 (12:56 +0200)]
[libmultipath] specify vendor/product as regular expressions

18 years ago[multipath] remove dead maps
Christophe Varoqui [Mon, 3 Oct 2005 15:46:24 +0000 (17:46 +0200)]
[multipath] remove dead maps

A map is considered dead, and thus removed from DM, when all its
constituent paths have disappeared from the system (ie sysfs).

When all paths fail, we keep the map, hoping some path can come back
up.

Flush will fail if the map is claimed (mount, ...), notify that.

This policy is rather safe, because :
- multipath is exec'ed only upon "add path events", so maps can magically
  disappear
- claimed maps cannot disappear

This map purge is clearly an interactive maintenance operation.

18 years ago[libmultipath] print a '-' as a placeholder for devname we can't resolve
Christophe Varoqui [Mon, 3 Oct 2005 13:05:02 +0000 (15:05 +0200)]
[libmultipath] print a '-' as a placeholder for devname we can't resolve

iet_lun0 (149455400000000000000000000000000d00600000b000000)
[size=67 GB][features="0"][hwhandler="0"]
\_ round-robin 0 [enabled]
 \_ 15:0:0:1 sdb 8:16  [active]
 \_ 16:0:0:1 sdd 8:48  [active]
 \_ 17:0:0:1 sdh 8:112 [active]
 \_ #:#:#:#  -   8:144 [active]
             ^
     here ---+

18 years ago[multipath] nice clean up possible now that we store wwids as map uuids
Christophe Varoqui [Mon, 3 Oct 2005 12:45:46 +0000 (14:45 +0200)]
[multipath] nice clean up possible now that we store wwids as map uuids

Thanks again, Patrick.

18 years ago[libmultipath] fix segfault on empty maps in dm_type()
Christophe Varoqui [Mon, 3 Oct 2005 10:28:43 +0000 (12:28 +0200)]
[libmultipath] fix segfault on empty maps in dm_type()

Reported by Maxim Kozover

18 years ago[libmultipath] devmap status parser fix
Christophe Varoqui [Sun, 2 Oct 2005 12:05:42 +0000 (14:05 +0200)]
[libmultipath] devmap status parser fix

The status information from path selectors that apply to paths are
repeated for each path. Current code assumed this info appears
only once per path group.

Stefan Bader, IBM

18 years ago[multipath] *bad bad nasty* map reload code path
Christophe Varoqui [Fri, 30 Sep 2005 13:19:02 +0000 (15:19 +0200)]
[multipath] *bad bad nasty* map reload code path

* the uuid needs not be set for DM_DEVICE_RELOAD
* remove map upon map load/reload failure is *wrong* *wrong*
* "int op" superfluous

18 years ago[libmultipath] forgoten fd init in struct.c:alloc_path()
Christophe Varoqui [Fri, 30 Sep 2005 12:24:35 +0000 (14:24 +0200)]
[libmultipath] forgoten fd init in struct.c:alloc_path()

18 years ago[libmultipath] get_claimed() could try to close a negative file descriptor
Christophe Varoqui [Fri, 30 Sep 2005 12:12:47 +0000 (14:12 +0200)]
[libmultipath] get_claimed() could try to close a negative file descriptor

When open() failed for another reason than EBUSY.

18 years ago[libmultipath] 0 _is_ a valid file descriptor
Christophe Varoqui [Fri, 30 Sep 2005 11:40:28 +0000 (13:40 +0200)]
[libmultipath] 0 _is_ a valid file descriptor

Stefan Bader, IBM

18 years ago[multipath] rules fix
Christophe Varoqui [Fri, 30 Sep 2005 10:15:43 +0000 (12:15 +0200)]
[multipath] rules fix

/sbin doesn't seem to be in the PATH when udev execs dmsetup.
Use absolute paths then.

18 years ago[multipath] workaround for a dmsetup bug in multipath.rules
Christophe Varoqui [Fri, 30 Sep 2005 10:00:41 +0000 (12:00 +0200)]
[multipath] workaround for a dmsetup bug in multipath.rules

dmsetup -n flag does not suppress the heading, as the manual suggests
it should. Though --noheadings works, so use that instead.

18 years ago[multipath] don't exit if pathvec is empty after discovery
Christophe Varoqui [Fri, 30 Sep 2005 08:25:06 +0000 (10:25 +0200)]
[multipath] don't exit if pathvec is empty after discovery

When all path fail or are removed by operator, but the maps are still
present, expected behaviour is for "multipath -l" to work.

IOW outs something like :

xa-s05:~/scm/multipath-tools-0.4.6# multipath/multipath -l
149455400000000000000000002000000d00600000b000000 ()
[size=67 GB][features="0"][hwhandler="0"]
\_ round-robin 0 [enabled]
 \_ 10:0:0:1 sdd 8:48 [active]

149455400000000000000000002000000d20600000b000000 ()
[size=33 GB][features="0"][hwhandler="0"]
\_ round-robin 0 [enabled]
 \_ 10:0:0:2 sde 8:64 [active]

xa-s05:~/scm/multipath-tools-0.4.6# iscsiadm -m node --logout --record=0203b2
xa-s05:~/scm/multipath-tools-0.4.6# multipath/multipath -l
149455400000000000000000002000000d00600000b000000 ()
[size=67 GB][features="0"][hwhandler="0"]
\_ round-robin 0 [enabled]
 \_ #:#:#:#   8:48 [active]

149455400000000000000000002000000d20600000b000000 ()
[size=33 GB][features="0"][hwhandler="0"]
\_ round-robin 0 [enabled]
 \_ #:#:#:#   8:64 [active]

18 years ago[multipath] set devmap UUID to multipath WWID
Christophe Varoqui [Thu, 29 Sep 2005 22:14:03 +0000 (00:14 +0200)]
[multipath] set devmap UUID to multipath WWID

If you use aliases to rename the multipath devices to something sensible you
lose the WWIDs, this patch stores them as the device-mapper UUID and retrieves
them so they can be displayed using multipath -l.

Patrick Caulfield, Redhat.

18 years agoOnly use one loop to read all data.
Bastian Blank [Thu, 29 Sep 2005 13:06:34 +0000 (13:06 +0000)]
Only use one loop to read all data.

18 years agoDon' use unalligned pointers, this is undefined behaviour.
Bastian Blank [Thu, 29 Sep 2005 13:01:45 +0000 (13:01 +0000)]
Don' use unalligned pointers, this is undefined behaviour.

18 years agoUse endian.h and byteswap.h.
Bastian Blank [Thu, 29 Sep 2005 12:55:36 +0000 (12:55 +0000)]
Use endian.h and byteswap.h.

18 years ago[libmultipath] generic discovery.c:wait_for_file()
root [Wed, 28 Sep 2005 21:03:32 +0000 (23:03 +0200)]
[libmultipath] generic discovery.c:wait_for_file()

clearly state the wait for file (sysfs or device node) logic is needed
only for multipathd, because it races udev upon uevent broadcast.

for multipath(8), which is ran by udev *after* devnode creation,
wait_for_file() just returns "ok".

18 years ago[multipath] the multipath udev rule voids the blacklist logic
root [Wed, 28 Sep 2005 08:14:30 +0000 (10:14 +0200)]
[multipath] the multipath udev rule voids the blacklist logic

"%M:%m" moved to "%r/%k"
with the assumption already used that these nodes exist.

18 years ago[multipath] yet another unchecked devt2devname() return value
root [Wed, 28 Sep 2005 08:08:46 +0000 (10:08 +0200)]
[multipath] yet another unchecked devt2devname() return value

This one caused a multipath -ll with no cache loaded to wait for a
pathinfo(nul) to complete for a path discovered in the map but not
present anymore in sysfs.

18 years ago[multipath] fix maj:min scope definition to a non-existant dev_t
root [Tue, 27 Sep 2005 22:29:26 +0000 (00:29 +0200)]
[multipath] fix maj:min scope definition to a non-existant dev_t

We didn't check the return value of dev_t to devname translator,
which caused the tentative discovery of a random device,
which stalled for 5sec before concluding it can't be scanned.

This bug hit bad with partitions for example.

18 years ago[build] will I have the build optimization right this time ?
root [Tue, 27 Sep 2005 14:42:03 +0000 (16:42 +0200)]
[build] will I have the build optimization right this time ?

Master Makefile linked multipathd with libmultipath objects built
without -DDAEMON ... wrong condlog define.

18 years ago[multipathd] shut a libdevmapper error message when adding paths
root [Tue, 27 Sep 2005 13:25:09 +0000 (15:25 +0200)]
[multipathd] shut a libdevmapper error message when adding paths

"device-mapper ioctl cmd 12 failed: No such device or address" was
reported upon path add because we tried to submit a device-mapper ioctl
before the map is ready to receive it (and loop till it works or timeout).

shut the libdevmapper for this case with dm_init_log(&dummy_log) during
this operation.

18 years ago[multipathd] dead maps garbage collector fix
root [Tue, 27 Sep 2005 11:10:09 +0000 (13:10 +0200)]
[multipathd] dead maps garbage collector fix

The collector could fail to catch all dead maps and/or point mem outside the
maps vector : fix the iteration logic.

18 years ago[multipath] multipath.rules is happy with install mode 644
root [Tue, 27 Sep 2005 09:48:53 +0000 (11:48 +0200)]
[multipath] multipath.rules is happy with install mode 644

previously set to 755.

18 years ago[multipath] oops, messed the rules badly with unescaped CR
root [Tue, 27 Sep 2005 09:43:53 +0000 (11:43 +0200)]
[multipath] oops, messed the rules badly with unescaped CR

18 years ago[multipath] forgot to remove multipath.dev refs in Makefile
root [Tue, 27 Sep 2005 08:48:41 +0000 (10:48 +0200)]
[multipath] forgot to remove multipath.dev refs in Makefile

18 years ago[multipath] adapt to the new udev rules
root [Tue, 27 Sep 2005 08:25:21 +0000 (10:25 +0200)]
[multipath] adapt to the new udev rules

dev.d/ and hotplug.d/ are deprecated.
Move multipath and multipath partitions triggers to rules.d/

Don't create /dev/ links anymore, we now use exclusively on /dev/mapper/

18 years ago[libmultipath] don't trust the path wwid from cache if pathinfo() fails
root [Mon, 26 Sep 2005 09:32:46 +0000 (11:32 +0200)]
[libmultipath] don't trust the path wwid from cache if pathinfo() fails

This kept the reduced map from loading when multipathd runs and a path
is failed or offline.

Also fix get_claimed() false positive returns by checking errno == EBUSY

18 years ago[libmultipath] fix multipath & multipathd startup corner case
root [Sat, 24 Sep 2005 17:42:39 +0000 (19:42 +0200)]
[libmultipath] fix multipath & multipathd startup corner case

I got a report about strange behaviour of "multipath -l" if one of the
devices that are used for multipathing is set offline.
In that case the code in libmultipath (discovery.c) just ends processing
and the output is incomplete.

Failing a pathinfo() now means the path is down.

If the device was really removed,
- we wouldn't discover it in multipath
- a "del" uevent would prevent further pathinfo() in multipathd

18 years ago[libmultipath] load default hwtable entries not overriden by configlets
root [Wed, 21 Sep 2005 21:04:37 +0000 (23:04 +0200)]
[libmultipath] load default hwtable entries not overriden by configlets

Rationale from Edward Goggin, EMC :

"
I'm wondering why when I put "device {}" entries in the multipath conf file
I
lose all of the other entries setup in the libmultipath/hwtable.c file.
Devices
which do not match the vendor and model strings of the device entries I
setup in the conf file are all forced to pick up default multipath
attributes.

This approach forces me to know the attributes for all vendor/model device
types in my SAN configuration whenever I want to setup even a small change
in the device attributes for a single device type.

I would rather see the that the entries that are setup in the conf file
simply
override the ones setup in the hwtable.c file.  Yet, entries already setup
in
the hwtable.c file which are not overridden remain valid.  The only devices
which pick up defaults are ones for which there is not a device entry in
either the libmultipath/hwtable.c file or the multipath conf file.
"

18 years ago[libmultipath] set pgfailback in internal hwtable entries
root [Wed, 21 Sep 2005 20:01:56 +0000 (22:01 +0200)]
[libmultipath] set pgfailback in internal hwtable entries

Edward Goggin, EMC

18 years ago[libmultipath] add "default_path_checker" config file keyword
root [Mon, 19 Sep 2005 19:25:25 +0000 (21:25 +0200)]
[libmultipath] add "default_path_checker" config file keyword

This will make for denser config files.

18 years ago[libmultipath] tweak the Symmetrix getuid callout default
root [Sat, 17 Sep 2005 22:55:09 +0000 (00:55 +0200)]
[libmultipath] tweak the Symmetrix getuid callout default

May want to patch the EMC SYMMETRIX hw entry in
libmultipath/hwtable.c to use the "-ppre-spc3-83"
scsi_id option.  Doing so will allow scsi_id to
return a UID derived from a version of a SCSI
Inquiry EVPD page 83 which is not compliant with
either SPC-2 or SPC-3 for an older model Symmetrix,
that is, models 4, 5 and some model sixes.

Edward Goggin, EMC

18 years ago[libmultipath] unix socket read/write loops fix
root [Sat, 17 Sep 2005 22:47:51 +0000 (00:47 +0200)]
[libmultipath] unix socket read/write loops fix

Those can tight loop. Do finer checks with errno.h to avoid that.

From Alasdair Kergon, Redhat.

18 years ago[libmultipath] remove absolete multipath_tool config keyword
root [Sat, 17 Sep 2005 21:53:47 +0000 (23:53 +0200)]
[libmultipath] remove absolete multipath_tool config keyword

multipathd used to call multipath(8), thus needed to know the callout path.
This is no longer the case, so clean it up.

18 years ago[multipathd] small fixes
root [Fri, 9 Sep 2005 10:32:01 +0000 (12:32 +0200)]
[multipathd] small fixes

- Remove_maps() did remove 1 out of 2 map.
  Only called on exit code path ...
- LCKDBG define to print useful code line number when using cleanup
  functions
- Warn when falling back to pthread_kill()
- Free the uevent struct in libmultipath/uevent.c receive loop, not
  in the trigger anymore.

18 years ago[multipathd] discard uevents on partitions too
root [Thu, 8 Sep 2005 09:54:25 +0000 (11:54 +0200)]
[multipathd] discard uevents on partitions too

18 years ago[multipathd] rename misnamed "struct paths" to "struct vectors"
root [Thu, 8 Sep 2005 07:39:51 +0000 (09:39 +0200)]
[multipathd] rename misnamed "struct paths" to "struct vectors"

18 years ago[priority] update the alua prioritizer 0.4.5
root [Fri, 26 Aug 2005 20:19:56 +0000 (22:19 +0200)]
[priority] update the alua prioritizer

Removes bitfields in the SCSI structs.
This didn't work on i386.

From Stefan Bader, IBM

18 years ago[priority] update pp_alua man page
root [Fri, 26 Aug 2005 20:06:42 +0000 (22:06 +0200)]
[priority] update pp_alua man page

and adapts the manpage to the new callout name.
From Stefan Bader, IBM.

18 years ago[multipathd] refuse to add blacklisted paths from CLI
root [Thu, 25 Aug 2005 07:01:23 +0000 (09:01 +0200)]
[multipathd] refuse to add blacklisted paths from CLI

18 years ago[multipathd] off-by-one buffer len error for cli.c:genhelp()
root [Thu, 25 Aug 2005 06:59:29 +0000 (08:59 +0200)]
[multipathd] off-by-one buffer len error for cli.c:genhelp()

18 years agoupdate template config files for rr_weight
root [Wed, 24 Aug 2005 15:02:21 +0000 (17:02 +0200)]
update template config files for rr_weight

... and purge uneeded configlets :

All tested hardware should be in the hard-coded defaults, no need to keep
the defaults out-of-sync in the templates config files.

18 years ago[multipath] option to use priorities as weights in the round-robin scheduler
root [Wed, 24 Aug 2005 14:48:40 +0000 (16:48 +0200)]
[multipath] option to use priorities as weights in the round-robin scheduler

Disabled by default.

Synthax is "rr_weight = priorities", and is valid in the default{},
device{} and multipath{} blocks.

This is an interim solution before a cleaner "least queued scheduler".

To make this complete, the daemon should be able to "message" DM to
change the path weights when their prio changes. Probably not worth the
effort and spend time on another scheduler.

The core of this patch is in the multipath table setup :

if (mp->rr_weight && pp->priority)
minio = conf->rr_minio * pp->priority;

The rest is the config switch handling, and printing.

18 years ago[build] last optimisation broke the dlog() switch. fix.
root [Wed, 24 Aug 2005 10:16:38 +0000 (12:16 +0200)]
[build] last optimisation broke the dlog() switch. fix.

dlog() contains #if DAEMON statements.

So debug.o needs rebuild between multipath(8) and multipathd(8) builds,
which did not happen anymore since the last optimisation.

18 years ago[libcheckers] add the directio checker
root [Wed, 24 Aug 2005 06:21:42 +0000 (08:21 +0200)]
[libcheckers] add the directio checker

Created by Hannes Reinecke, Suse, mainly for DASD devices.

18 years ago[build] shut a find usage warning (again)
root [Tue, 23 Aug 2005 15:04:27 +0000 (17:04 +0200)]
[build] shut a find usage warning (again)

18 years ago[libmultipath] '\0'-terminate snprint_*() buffers
root [Tue, 23 Aug 2005 15:02:44 +0000 (17:02 +0200)]
[libmultipath] '\0'-terminate snprint_*() buffers

18 years ago[libmultipath] don't re-select when not necessary in path discovery
root [Tue, 23 Aug 2005 14:16:00 +0000 (16:16 +0200)]
[libmultipath] don't re-select when not necessary in path discovery

.getprio, .getuid and .checkfn were needlessly re-selected each time the
corresponding value was updated through discovery.c:pathinfo().

Now that we are more selective, we need to :
- flush the cached values for multipath(8)
- re-select them in case of multipathd(8) "reconfigure" CLI command

18 years ago[libmultipath] fix segfault in print.c when MAX_LINE_LEN is reached
root [Tue, 23 Aug 2005 14:08:04 +0000 (16:08 +0200)]
[libmultipath] fix segfault in print.c when MAX_LINE_LEN is reached

18 years ago[libmultipath] remove offending "\n" in print.c
root [Tue, 23 Aug 2005 12:11:38 +0000 (14:11 +0200)]
[libmultipath] remove offending "\n" in print.c

They are already dealt with in the format string

18 years ago[multipathd] update priorities upon path check
root [Tue, 23 Aug 2005 10:34:25 +0000 (12:34 +0200)]
[multipathd] update priorities upon path check

and failback if need be.
nice to see in action with pp_random and failover grouping policy :/

0IET_____ISCSI___________00000000d20600000b00000000000000: switch to path group #1
0IET_____ISCSI___________00000000d20600000b00000000000000: switch to path group #3
0IET_____ISCSI___________00000000d00600000b00000000000000: switch to path group #2
...

18 years ago[multipath] show path group priority value in '-ll' and map [re]load modes
root [Tue, 23 Aug 2005 08:34:46 +0000 (10:34 +0200)]
[multipath] show path group priority value in '-ll' and map [re]load modes

Asked by Ed Goggin, EMC, to diagnose easily when failback may be opportune.

18 years ago[kpartx] shut a build warning
root [Tue, 23 Aug 2005 07:54:38 +0000 (09:54 +0200)]
[kpartx] shut a build warning

18 years ago[libmultipath] move snprint_[path|map]() to format based printing fns
root [Fri, 19 Aug 2005 15:57:06 +0000 (17:57 +0200)]
[libmultipath] move snprint_[path|map]() to format based printing fns

 * path format magics :
 *
 * %w : multipath uid
 * %i : scsi tuple
 * %d : device name
 * %D : device major:minor
 * %t : device mapper path status
 * %T : checker path status
 * %s : scsi strings
 * %c : claimed
 *
 * map format magics :
 *
 * %w : multipath uid
 * %d : DM device name
 * %F : failback countdown
 * %C : checker countdown

and update all callers (nice cleanup).

The printing buffer overflow checking is done right at last.

18 years ago[multipath] DM-claimed paths are not to be considered as claimed
root [Fri, 19 Aug 2005 09:48:31 +0000 (11:48 +0200)]
[multipath] DM-claimed paths are not to be considered as claimed

Use the dmstate path field to guess if the path is used bythe DM
driver. This assumes disassemble_*() have been called before the guess.

18 years ago[libmultipath] comestic changes
root [Fri, 19 Aug 2005 09:38:35 +0000 (11:38 +0200)]
[libmultipath] comestic changes

In struct.h, moved a bunch of defines to enums :
- SYSFS_BUS_*
- [KEEP|FREE]_PATHS
- FAILBACK_*

Renamed *_RESERVED to *_UNDEF all over includes.

Update all users.

18 years ago[build] be smarter at guessing when libs rebuild is needed
root [Thu, 18 Aug 2005 18:43:04 +0000 (20:43 +0200)]
[build] be smarter at guessing when libs rebuild is needed

Without breaking the klibc stuff.
Total build time shortened a lot on small systems.

18 years ago[build] remove uneeded path_priority/Makefile
root [Thu, 18 Aug 2005 18:40:33 +0000 (20:40 +0200)]
[build] remove uneeded path_priority/Makefile

now that we find out what dirs to go compile into, no need for
intermediate Makefile

18 years ago[build] be smarter at guessing BUILDDIRS
root [Thu, 18 Aug 2005 18:22:37 +0000 (20:22 +0200)]
[build] be smarter at guessing BUILDDIRS

and remove now useless $INSTALLDIRS and $ALLDIRS

18 years ago[multipathd] fix occasional CLI output trailing garbage
root [Wed, 17 Aug 2005 16:16:46 +0000 (18:16 +0200)]
[multipathd] fix occasional CLI output trailing garbage

caused by an off-by-one reply len calculation in show_paths()
and show_maps()

18 years ago[libmultipath] working claimed device detection
root [Wed, 17 Aug 2005 16:01:59 +0000 (18:01 +0200)]
[libmultipath] working claimed device detection

done with O_EXCL

18 years ago[getuid] add usb_id
root [Wed, 10 Aug 2005 16:41:09 +0000 (18:41 +0200)]
[getuid] add usb_id

Well, this is useful for testing with usb keys