platform/upstream/multipath-tools.git
19 years ago[multipathd] uxsock patch
root [Fri, 24 Jun 2005 12:30:17 +0000 (14:30 +0200)]
[multipathd] uxsock patch

I was playing around with the CLI, and having some issues. Occasionally
commands wouldn't work, which was because multipathd was using string
functions on strings that weren't NULL terminated. Also, if you just typed
in junk for the name of the map to remove, it would always remove dm-0,
because atoi returned 0.  I fixed those, added some moron-proofing checks,
and made multipathd reply "fail" if the command failed.

Here's the patch

Benjamin Marzinski, Redhat.

19 years ago[multipathd] assorted cleanups
root [Fri, 24 Jun 2005 10:47:15 +0000 (12:47 +0200)]
[multipathd] assorted cleanups

- remove the superfluous dm_mapname() "target type" param
- log more errors in the devmapper wrapper library
- in "struct event_thread" move from "pthread * thread" to "pthread thread"
- introduce a pthread_cleanup function
- wrap the waiter thread dmt in the "struct event_thread" for cleanup
- put cancelation points around the WAIT ioctl
- introduce a garbage collector to remove dead entries in the mpvec
- use strdup instead of asprintf as the later produce warnings here

19 years ago[multipathd] shut a warning down
root [Fri, 24 Jun 2005 09:32:23 +0000 (11:32 +0200)]
[multipathd] shut a warning down

assignment used as test value in the readline loop.

19 years ago[multipath] map flushing to remove layered DM-partitioned too
root [Wed, 22 Jun 2005 13:04:27 +0000 (15:04 +0200)]
[multipath] map flushing to remove layered DM-partitioned too

"multipath -F" or "multipath -f $map" refused to remove a map if kpartx
layered partioned upon it. This patch should take care of that.

19 years ago[multipath] express the failback delay in seconds
root [Wed, 22 Jun 2005 09:49:52 +0000 (11:49 +0200)]
[multipath] express the failback delay in seconds

Failback is still scheduled upon path going up and canceled upon paths
going down.

19 years ago[multipathd] add "sg $map $pgindex" CLI command
root [Wed, 22 Jun 2005 09:21:37 +0000 (11:21 +0200)]
[multipathd] add "sg $map $pgindex" CLI command

To trigger a PG switch.

Somewhat asked by Lars.

19 years ago[multipath] remove dead paths from maps
root [Tue, 21 Jun 2005 22:47:30 +0000 (00:47 +0200)]
[multipath] remove dead paths from maps

Resurect pgcmp in place of pgcmp2.

pgcmp2 allowed dead path to remain in the multipath devmap.
Alasdair was reluctant to reload maps in critical paths, so
this heuristic avoided such unwanted reload.

In the 0.4.5 dev branch, the daemon never touch the maps, it just sends
"DM messages". So I guess it's safe to remove that heuristic.

19 years ago[multipath] new '-f' command line flag
root [Tue, 21 Jun 2005 21:49:09 +0000 (23:49 +0200)]
[multipath] new '-f' command line flag

This selectively removes an unused multipath map.

19 years ago[multipathd] re-enable disabled PG when at least one path is up
root [Tue, 21 Jun 2005 10:06:27 +0000 (12:06 +0200)]
[multipathd] re-enable disabled PG when at least one path is up

Kernel DM is able to disable PG, so userspace daemon should take care of
re-enabling them when appropriate.

Suggested by Ed Goggin, EMC.

19 years ago[libmultipath] commit the unix socket lib
root [Tue, 21 Jun 2005 06:35:59 +0000 (08:35 +0200)]
[libmultipath] commit the unix socket lib

Forgoten in the main commit.
Thanks to Benjamin Marzinski, Redhat, for noticing.

19 years ago[multipathd] don't check at all if path is orphaned
root [Mon, 20 Jun 2005 21:45:41 +0000 (23:45 +0200)]
[multipathd] don't check at all if path is orphaned

Orphaned as in "a checher is registered for this path, but it does not
belong to any map". We wouldn't know what to do if its state changed
anyway.

Suggested by Ed Goggin.

19 years ago[libmultipath] forgot blacklist.c in the previous commit
root [Mon, 20 Jun 2005 15:17:42 +0000 (17:17 +0200)]
[libmultipath] forgot blacklist.c in the previous commit

19 years ago[libmultipath] better default blacklist rules
root [Mon, 20 Jun 2005 15:08:32 +0000 (17:08 +0200)]
[libmultipath] better default blacklist rules

an LU with a scsi_id assigned UID of 36006016087711200afd8d0905137d911 was being blacklisted because the default blacklist includes a regular expression of the form "(ram | raw | loop | fd)[0-9]*" which happens to match the substring "fd8" in the UID.  I've fixed the problem by changing the blacklist regular expression to instead be "^(ram | raw | loop | fd)[0-9]*" since the intention is really to exclude devices from multipath discovery only when their name __begins__ with any of the prefixes within the parenthesis.  Turns out "fd" is the  only one of these listed prefixes which contains exclusively valid alpha-hexa-numeric characters.  The "fd" Characters should not mistakenly collide with hexa-numeric characters at the beginning of at least a scsi_id assigned block device UID since scsi_id is assigning either an alpha 0, 1, 2, or 3 to the first character of the UID string.

This problem is likely in all versions of multipath-tools since 0.4.4-pre7 when the use of both regcomp and regexec were first introduced.

19 years ago[multipathd] daemon survives a path add when its map is not registered
root [Mon, 20 Jun 2005 12:03:56 +0000 (14:03 +0200)]
[multipathd] daemon survives a path add when its map is not registered

So much bugs found with this nice CLI :)

19 years ago[multipathd] survive a map removal
root [Mon, 20 Jun 2005 10:33:58 +0000 (12:33 +0200)]
[multipathd] survive a map removal

A bug much easier to trigger now that we can remove maps from the CLI.

19 years ago[multipathd] don't historize empty cli commands
root [Mon, 20 Jun 2005 10:32:14 +0000 (12:32 +0200)]
[multipathd] don't historize empty cli commands

19 years ago[multipathd] readline support for daemon control shell
root [Mon, 20 Jun 2005 07:57:20 +0000 (09:57 +0200)]
[multipathd] readline support for daemon control shell

... with history

19 years ago[multipathd] unix socket daemon control interface
root [Mon, 20 Jun 2005 07:44:49 +0000 (09:44 +0200)]
[multipathd] unix socket daemon control interface

The client is wrapped in the daemon.

You can call it through :
- multipathd -k"$cmd" : one shot
- multipathd -k : interactive

The synthax is somewhat rude :/

- lp : list paths
- lm : list maps
- ap $path : add path checker, $path is in the "sdb" form
- rp $path : remove path checker
- am $map : add map event thread, $map is in the "dm-0" form
- rm $map : remove map event thread

19 years ago[checkers] new hp_sw checker for StorageWorks hw
root [Tue, 14 Jun 2005 12:40:48 +0000 (14:40 +0200)]
[checkers] new hp_sw checker for StorageWorks hw

This checker is a tri-state : up, down, ghost.

Ghost state is defined as (inq succesful && tur fails)
Up state is defined as (inq succes && tur succesful)
Down state is defined as (inq fails)

multipath modified to print [ghost] as a pstate when appropriate.
multipathd modified to reinstate path in ghost state, as it does with "up".

This final mod was the goal of the patch : indeed the SCSI_START hardware
handler is asked to init a PG only if it has at least one active path.
We previously considered ghost paths as failed, so the daemon proactiveled
deactivated these paths, which kept the hwhandler from being given a
chance to ask for a controler switch by sending a SCSI_START.

Survives my testing here on EVA5000.

19 years ago[multipath] get rid of the "best" pg info in output
root [Mon, 13 Jun 2005 14:45:06 +0000 (16:45 +0200)]
[multipath] get rid of the "best" pg info in output

Truely redondant with [active].

19 years ago[multipath] fix -l and -ll flags with a specified limited scope
root [Mon, 13 Jun 2005 13:35:53 +0000 (15:35 +0200)]
[multipath] fix -l and -ll flags with a specified limited scope

When listing scope is limited to a specific device or map, we can't skip fetching the wwid for each path, as it is the path elimination criterium.

19 years ago[path_priority] rename prioritizers
root [Fri, 10 Jun 2005 21:28:33 +0000 (23:28 +0200)]
[path_priority] rename prioritizers

"pp is too easy to confuse with ppp and does not help anyone guess
what the binary does - not least because there are no man pages yet!

So it should include some characters that suggest it's connected
with dm multipath."

From Alasdair Kergon, RedHat

19 years ago[multipathd] adjust chkconfig values in redhat init script
root [Fri, 10 Jun 2005 17:36:41 +0000 (19:36 +0200)]
[multipathd] adjust chkconfig values in redhat init script

From Alasdair Kergon, RedHat.

19 years ago[libmultipath] sysfs_get_bus() fix 0.4.5-pre3
root [Fri, 3 Jun 2005 09:31:54 +0000 (11:31 +0200)]
[libmultipath] sysfs_get_bus() fix

From Mike Anderson, tested on SCSI and iSCSI

19 years ago[multipathd] '-d' param to log to stdout
root [Thu, 2 Jun 2005 11:56:51 +0000 (13:56 +0200)]
[multipathd] '-d' param to log to stdout

This replaces the build-time LOG_THREAD_DISABLE define, and is far
more versatile : this flag is compatible with the log verbosity flag.

19 years ago[libmultipath] bus abstraction in path discovery
root [Wed, 1 Jun 2005 23:03:59 +0000 (01:03 +0200)]
[libmultipath] bus abstraction in path discovery

First pass to modularize the most obvious SCSI-centric code.

19 years ago[libmultipath] hardware table update
root [Wed, 1 Jun 2005 15:21:09 +0000 (17:21 +0200)]
[libmultipath] hardware table update

Some hardware switched from MULTIBUS to GROUP_BY_SERIAL

19 years ago[libmultipath] fetch path info before storing the path in pathvec
root [Wed, 1 Jun 2005 09:34:32 +0000 (11:34 +0200)]
[libmultipath] fetch path info before storing the path in pathvec

Thus, if pathinfo() fails, no need to clean up the vector.

This fixes a segfault in free_pathvec() trying to free a path already
freed in pathinfo() error handler.

19 years ago[multipathd] enable the defered failback feature
root [Sat, 28 May 2005 16:33:54 +0000 (18:33 +0200)]
[multipathd] enable the defered failback feature

The failback config file keyword activates defered failback when set to
an integer value superior to zero. This value expresses the number of
consecutive successful path check before failback.

Remember the path testing delay arithmeticaly increases when consecutive
checks report PATH_UP. This affects the calculation of the failback delay
in seconds.

Failback is canceled as soon as a path in the multipath goes down, and
is rescheduled when a path goes up.

19 years ago[multipathd] fix uevent trigger fn return values
root [Fri, 27 May 2005 15:20:16 +0000 (17:20 +0200)]
[multipathd] fix uevent trigger fn return values

o uevent from a non-/block object is discarded without error
o unknown dm- object uevents are discarded without error
o lock a bit earlier for unlock symmetry in the out path

The bogus and confusing "uevent trigger error" log messages
are now gone.

19 years ago[libmultipath & multipathd] tidy up some error code paths
root [Fri, 27 May 2005 15:02:27 +0000 (17:02 +0200)]
[libmultipath & multipathd] tidy up some error code paths

Cascade pathinfo() error return value to callers in discovery.c
Log on more error paths in multipathd/main.c

19 years ago[libmultipath] opennode() must wait for udev to create the devnode
root [Fri, 27 May 2005 14:49:10 +0000 (16:49 +0200)]
[libmultipath] opennode() must wait for udev to create the devnode

Indeed, now that the daemon races udev in receiving uevents, it can
try opening the devnode before udev is given a chance to create it.

Do that the same way we wait for sysfs files to appear.

19 years ago[multipathd] update pg states before deciding if pg switch is needed
root [Fri, 27 May 2005 13:52:47 +0000 (15:52 +0200)]
[multipathd] update pg states before deciding if pg switch is needed

Plus update_multipath() code split into :

o update_multipath_table()
o update_multipath_status()
o update_multipath strings(), which chains to 2 previous fn

Multipath configurator now outs "best" instead of "first" to better
express a failback might be necessary "when best != active pg"

19 years ago[multipathd] suppress the switch group message when no switch occured
root [Fri, 27 May 2005 10:20:50 +0000 (12:20 +0200)]
[multipathd] suppress the switch group message when no switch occured

19 years ago[multipathd] don't switch to already active group
root [Fri, 27 May 2005 06:41:43 +0000 (08:41 +0200)]
[multipathd] don't switch to already active group

This simple protection saves us a DM event per switch_group message.

19 years ago[multipathd] failback property selector fixes
root [Thu, 26 May 2005 21:35:45 +0000 (23:35 +0200)]
[multipathd] failback property selector fixes

Cut'n paste haste ... corrected
Should fix Tran Lan report added to bug [156280] today.

19 years ago[multipathd] add failback keyword handling
root [Wed, 25 May 2005 09:53:18 +0000 (11:53 +0200)]
[multipathd] add failback keyword handling

The failback keyword can be set in the default section, or in a hardware
entry, or in a multipath entry. Its value can be "manual", "immediate" or
an integer delay expressed in seconds.

19 years ago[PATCH][Bug 158603] local variable used before set
root [Tue, 24 May 2005 09:30:25 +0000 (11:30 +0200)]
[PATCH][Bug 158603] local variable used before set

.

19 years ago[multipathd]
root [Tue, 17 May 2005 14:52:17 +0000 (16:52 +0200)]
[multipathd]

Complete the uevent framework.

The missing bit was the devmap add/remove events handling. Now that it
is in place, get rid of wait_thr altogether : kill the waiters vector,
the "lease" thing.

Helpers added in the process :

o libmultipath/devmapper.c:dm_mapname()
o libmultipath/structs.c:find_mp_by_minor()

Worth noting, devmap remove uevents don't get reliably delivered.
If someone have an explanation I'm interested.

19 years ago[libmultipath]
root [Mon, 16 May 2005 21:45:49 +0000 (23:45 +0200)]
[libmultipath]

uevents delivery is too fast for sysfs files creation to complete
before we try to use them in discovery.c

The problem is well known to udev developpers, so merge their
wait loop in discovery.c

19 years ago[PATCH] call dm_lib_release/exit explicitly in multipath-tools
root [Mon, 16 May 2005 21:08:31 +0000 (23:08 +0200)]
[PATCH] call dm_lib_release/exit explicitly in multipath-tools

multipath-tools should call dm_lib_release() and dm_lib_exit()
before it returns.  Then, libdevmapper will call update_devs()
and finalize the device node operation which creates
/dev/mapper/<map_name>.

This patch may not be needed if the latest libdevmapper of the
device-mapper CVS is used, since in the latest version,
dm_lib_exit() calls dm_lib_release() and dm_lib_exit() is called
by default when the program returns.

Regards,
Kiyoshi Ueda

19 years ago[multipathd]
root [Mon, 16 May 2005 21:04:53 +0000 (23:04 +0200)]
[multipathd]

When a path is added through a uevent, set the pp->mpp ownership.

A little infrastructure added to help :

o store_pathinfo() now returns the path pointer
o add find_mp_by_wwid()

19 years ago[multipathd]
root [Mon, 16 May 2005 13:08:19 +0000 (15:08 +0200)]
[multipathd]

Jumbo patch :

o get rid of the last multipath configurator call
o introduce the native path group switching logic.
  For now only two behaviours :
  o FAILBACK_MANUAL
  o FAILBACK_IMMEDIATE
o get rid of path group ids unused bits
o paths and multipaths full scan is only done once now.
  Moved one step earlier, in child(). Lists housekeeping done
  through uevents (well, the mpvec part is yet to come)

19 years ago[multipathd]
root [Fri, 13 May 2005 11:56:18 +0000 (13:56 +0200)]
[multipathd]
Reinstate paths from the daemon. Don't rely on successful multipath exec
for that anymore.

Multipath is now only used to do the path group switches, which will
eventualy be merge in the daemon too.

Plug a locking weakness introduced with pp->mpp usage.

19 years ago[config]
root [Fri, 13 May 2005 09:06:32 +0000 (11:06 +0200)]
[config]
Comment all lines in the example configuration file to force users to
uncomment only what they need.

This best practice was suggested by Kiyoshi Ueda, NEC.

19 years ago[multipathd]
root [Thu, 12 May 2005 18:15:53 +0000 (20:15 +0200)]
[multipathd]
The "checking paths" debug message is not correct anymore. Change that to
a nice "tick" :/

19 years ago[multipathd]
root [Thu, 12 May 2005 18:13:17 +0000 (20:13 +0200)]
[multipathd]
The load_config() introduction in the daemon broke the polling_interval
keyword parsing. Fix That.

19 years ago[multipathd]
root [Thu, 12 May 2005 18:05:26 +0000 (20:05 +0200)]
[multipathd]
Checker delay throttle, the easy way :

o max_checkint is set to (checkint * 4)
o after one successful checks, each consecutive successful check bump
  up the checkint for the path by a factor of 2, toping at max_checkint
o path state change and mark_failed_paths() reset the checkint to its
  minimal value

19 years ago[kpartx]
root [Thu, 12 May 2005 16:49:36 +0000 (18:49 +0200)]
[kpartx]
Try another approach at fixing the dev_t definition glitch with glibc headers

19 years ago[multipathd]
root [Thu, 12 May 2005 09:23:36 +0000 (11:23 +0200)]
[multipathd]
Refresh devmap list and initiate DM event waiter threads housekeeping upon device map add/remove uevent.

19 years ago[multipathd]
root [Mon, 9 May 2005 14:11:40 +0000 (16:11 +0200)]
[multipathd]
Remove unsupported getopt() flags, mistakenly inherited from multipath

19 years ago[multipathd]
root [Mon, 9 May 2005 14:10:05 +0000 (16:10 +0200)]
[multipathd]
Use load_config() in the daemon too.

19 years ago[libmultipath]
root [Mon, 9 May 2005 14:01:38 +0000 (16:01 +0200)]
[libmultipath]
In load_config(), don't bother allocating a new struct config if already allocated. Don't override a previously set conf->verbosity (by getopt for example)

19 years ago[libmultipath]
root [Mon, 9 May 2005 13:57:18 +0000 (15:57 +0200)]
[libmultipath]
Remove a signal remnent in struct config and load_config()

19 years ago[multipathd]
root [Thu, 5 May 2005 22:07:16 +0000 (00:07 +0200)]
[multipathd]
Logging code in multipathd cause unaligned access
which, on ia64, yields logs on both console and syslog like:
unaligned access to 0x60000000000141d1, ip=0x4000000000009d81

It's harmless except for the slight performance effect.
However, it's annoying for users and better to fix.

Attached patch aligns the la->tail to pointer size.

Jun'ichi Nomura, NEC

19 years ago[multipath]
root [Wed, 4 May 2005 15:46:28 +0000 (17:46 +0200)]
[multipath]
0:0:0:0 is a valid host/bus/target/lun tuple, so don't print that for disappeared paths that are kept in the map in case they come back up.
print_path now prints #:#:#:# instead.

19 years ago[multipathd]
root [Wed, 4 May 2005 15:29:04 +0000 (17:29 +0200)]
[multipathd]
path_discovery() and store_pathinfo() need the "|DI_WWID" flag for set_path_owner to work().
This should fix the problem with proactive path failing not working.

19 years ago[multipathd]
root [Wed, 4 May 2005 11:03:19 +0000 (13:03 +0200)]
[multipathd]
path_discovery() should at least fetch DI_SYSFS to set the dev_t for checkers
Also removed unused sysfs_path param in path_discovery_locked() prototype

19 years ago[multipath]
root [Wed, 4 May 2005 10:47:08 +0000 (12:47 +0200)]
[multipath]
'-l' flag now displays only info provided by sysfs and DM
'-ll' flag displays what '-l' used to display
Man page updated accordingly

19 years ago[multipath]
root [Wed, 4 May 2005 08:38:42 +0000 (10:38 +0200)]
[multipath]
Update version string to 0.4.5

19 years ago[multipath][multipathd]
Christophe Varoqui [Tue, 3 May 2005 21:45:17 +0000 (14:45 -0700)]
[multipath][multipathd]
Remove remnents of the '-S' flag handling.
Benjamin Marzinski, RedHat

19 years ago[multipathd]
Christophe Varoqui [Tue, 3 May 2005 21:18:55 +0000 (14:18 -0700)]
[multipathd]
Apply blacklist to uevents too.
Indeed, we don't want too add a checker on /dev/dm-0 when this devmap comes up.

19 years ago[multipathd]
Christophe Varoqui [Mon, 2 May 2005 21:19:48 +0000 (14:19 -0700)]
[multipathd]
Log only once the failure messages in loops.
Should close https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=156641

19 years ago[multipathd]
Christophe Varoqui [Mon, 2 May 2005 21:05:34 +0000 (14:05 -0700)]
[multipathd]
Definitely kill the "initial map reconfigure" at daemon startup.
The daemon shouldn't do surprising things like that.

19 years ago[libmultipath]
Christophe Varoqui [Mon, 2 May 2005 20:55:57 +0000 (13:55 -0700)]
[libmultipath]
Clariion arrays need the "queue_if_no_path" feature for the system to survive a firmware rolling upgrade. Set it by default in hwtable.c
Suggested by Edward Goggin, EMC

19 years ago[multipath]
Christophe Varoqui [Sun, 1 May 2005 23:17:46 +0000 (16:17 -0700)]
[multipath]
Check for root privilege before running.
Avoids failing on first DM ioctl.

19 years ago[build]
Christophe Varoqui [Sun, 1 May 2005 22:10:03 +0000 (15:10 -0700)]
[build]
Don't include ".git" in recursive make

19 years agoInitial git import.
Christophe Varoqui [Sun, 1 May 2005 22:05:22 +0000 (15:05 -0700)]
Initial git import.
Release 0.4.5-pre2