platform/upstream/multipath-tools.git
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

18 years ago[libmultipath] simplify the blacklist handling
root [Wed, 10 Aug 2005 16:38:11 +0000 (18:38 +0200)]
[libmultipath] simplify the blacklist handling

No need to carry along the regex string.
So no need for a "struct blentry".
Now a blist vector directly holds regex_t entries.

18 years ago[multipath] correct map size display
root [Wed, 10 Aug 2005 13:21:13 +0000 (15:21 +0200)]
[multipath] correct map size display

off-by-one shifting error.

18 years ago[libmultipath] support multipath maps >2TB
root [Wed, 10 Aug 2005 12:43:43 +0000 (14:43 +0200)]
[libmultipath] support multipath maps >2TB

Size field moved to ULL in struct path and multipath, as per
$KSRC/drivers/block/genhd.c suggests /sys/block/*/size size is.

Users updated.

18 years ago[multipath] handle alias changes in config file 0.4.5-pre4
root [Thu, 28 Jul 2005 14:31:10 +0000 (16:31 +0200)]
[multipath] handle alias changes in config file

Now initiate a remove / add sequence upon alias change in the config file.
The daemon catches on.

18 years ago[multipathd] '-d' command line flag does not fork anymore
root [Thu, 28 Jul 2005 07:43:58 +0000 (09:43 +0200)]
[multipathd] '-d' command line flag does not fork anymore

'-d' flag did instruct the daemon to send its output to stdout instead of
the the logger thread. It now also have the consequence to not fork, so
the daemon is easily breakable from the shell.

18 years ago[multipathd] add the reconfigure CLI command
root [Thu, 28 Jul 2005 07:38:33 +0000 (09:38 +0200)]
[multipathd] add the reconfigure CLI command

18 years ago[libmultipath] socket filesystem location moved to /var/run
root [Wed, 27 Jul 2005 09:27:42 +0000 (11:27 +0200)]
[libmultipath] socket filesystem location moved to /var/run

As per LSB directions, according to Lars.

18 years ago[libmultipath] third cut at output column aligning
root [Wed, 27 Jul 2005 09:14:23 +0000 (11:14 +0200)]
[libmultipath] third cut at output column aligning

- remove libcheckers/path_state.c (consolidated into libmultipath/print.c)
- move the path status printing to print.c
- so finaly rename print_*_id() to snprint_*()

Pondered using this status format :

iet_lun0 (0IET_____ISCSI___________00000000d00600000b00000000000000)
[size=67 GB][features="0"][hwhandler="0"]
\_ round-robin 0        E
  \_ 1:0:0:1  sdb 8:16  AA.
\_ round-robin 0        E
  \_ 2:0:0:1  sdd 8:48  AA.
\_ round-robin 0        E
  \_ 24:0:0:1 sdf 8:80  AA.
\_ round-robin 0        E
  \_ 25:0:0:1 sdh 8:112 AA.

but no consensus reached on the list.
Keep the old one for now, and git log for reference.

18 years ago[multipathd] fix 2 log issues
root [Wed, 27 Jul 2005 06:40:36 +0000 (08:40 +0200)]
[multipathd] fix 2 log issues

There are two log issues that I uncovered. #1 If the log is emptied when
the tail points to the very end of the log area, and the next message needs
to roll over to the start, it doesn't pull the head around too, so the head
is pointing at an empty message, causing you to print a priority 0 message
of nothing. #2 It is possible for the log to be totally full, and on the
next enqueue, have the log tail point to the log head, which causes the
entire existing log to be lost.

This patch fixes both.

-Ben Marzinski

18 years ago[libchecker] readsector0 compilation warning fix
root [Tue, 26 Jul 2005 12:22:20 +0000 (14:22 +0200)]
[libchecker] readsector0 compilation warning fix

sg_read() take an unsigned char array as param, where the checker
passed a char array.

18 years ago[libmultipath] second cut at output column aligning
root [Tue, 26 Jul 2005 09:19:41 +0000 (11:19 +0200)]
[libmultipath] second cut at output column aligning

Column-align the "show maps" CLI command ouput.

18 years ago[libmultipath] first cut at output column aligning
root [Mon, 25 Jul 2005 12:49:28 +0000 (14:49 +0200)]
[libmultipath] first cut at output column aligning

Introduce libmultipath/print.[ch]
Use it to column-align multipath output and multipathd CLI messages

18 years ago[multipathd] fix daemon crash in enable_group() be pp->pgindex is nul
root [Fri, 22 Jul 2005 16:01:02 +0000 (18:01 +0200)]
[multipathd] fix daemon crash in enable_group() be pp->pgindex is nul

if a path is added through uev_add_path, pgindex can be unset.

we can safely skip enable_group() in this case, because upon next map
reload, all PG will be enabled.

18 years ago[multipath] revoke pp->mpp after loading a "struct path" from the daemon
root [Fri, 22 Jul 2005 15:05:46 +0000 (17:05 +0200)]
[multipath] revoke pp->mpp after loading a "struct path" from the daemon

Fix the multipath configurator believing it has nothing to do because
pp->mpp is already set, ie pp is already coalesced.

18 years ago[multipathd] move the shutdown message down in the shutdown sequence
root [Fri, 22 Jul 2005 10:18:08 +0000 (12:18 +0200)]
[multipathd] move the shutdown message down in the shutdown sequence

18 years ago[checkers] remove trailing '\n' in checker messages
root [Fri, 22 Jul 2005 10:11:21 +0000 (12:11 +0200)]
[checkers] remove trailing '\n' in checker messages

18 years ago[libmultipath] condlog() not to enqueue uneeded logs
root [Fri, 22 Jul 2005 08:07:55 +0000 (10:07 +0200)]
[libmultipath] condlog() not to enqueue uneeded logs

Message enqueueing didn't check for verbosity level.
Corrected.

18 years ago[multipathd] Two little issues with unix socket lsnr.
root [Thu, 21 Jul 2005 21:35:23 +0000 (23:35 +0200)]
[multipathd] Two little issues with unix socket lsnr.

Multipathd was shutting down whenever I tried to start up gdb monitoring
on it, because uxlsnr code didn't like getting a signal.

Also, having a lot of overlapping calls to the uxlsnr code caused really
bad things to happen because of a linked list oversight.

This patch corrects both.

Benjamin Marzinski, Redhat

18 years ago[libmultipath] no need to msg when multipath can't connect to uxsock
root [Thu, 21 Jul 2005 18:54:20 +0000 (20:54 +0200)]
[libmultipath] no need to msg when multipath can't connect to uxsock

18 years ago[multipath and multipathd] remove the path cache file logic
root [Thu, 21 Jul 2005 15:58:45 +0000 (17:58 +0200)]
[multipath and multipathd] remove the path cache file logic

Replace by an Unix socket communication with the daemon.

The daemon has its pathvec always up-to-date, thanks to its
event-driven model.

As a side-effect, people who care about early userspace have now
2 options :

1) No daemon in early userspace, and disable hotplug-triggered multipath.
   /sbin/multipath is ran once.

2) Start the daemon in early userspace, let multipath be hotplug-triggered

Comments welcome on dm-devel. It's not too late to revert the thing :/

18 years ago[multipathd] dead includes yearly clean up in main.c
root [Thu, 21 Jul 2005 06:42:50 +0000 (08:42 +0200)]
[multipathd] dead includes yearly clean up in main.c

18 years ago[multipathd] remove copy.[ch]
root [Thu, 21 Jul 2005 06:34:06 +0000 (08:34 +0200)]
[multipathd] remove copy.[ch]

The only user was prepare_namespace(), gone.

18 years ago[libmultipath] add HSV110 to the hwtable
root [Wed, 20 Jul 2005 09:03:42 +0000 (11:03 +0200)]
[libmultipath] add HSV110 to the hwtable

18 years ago[multipathd] uevent trigger to not react to "remove map"
root [Wed, 20 Jul 2005 08:40:57 +0000 (10:40 +0200)]
[multipathd] uevent trigger to not react to "remove map"

... for now.

The DM event waiter thread pins the devmap kobj.
Thus no uevent is triggered upon map removal until the thread is reaped.
Chicken and egg.

We have the mpvec garbage collector now anyway.

18 years ago[build] 'find' warning fix
root [Wed, 20 Jul 2005 08:35:23 +0000 (10:35 +0200)]
[build] 'find' warning fix

Recent versions of find (Debian SID for example) warn about order of
min/maxdepth params. So reorder to keep the bugger happy.

18 years ago[multipathd] SIGUSR1 to SIGHUP for alt thread cancelation
root [Wed, 20 Jul 2005 08:30:25 +0000 (10:30 +0200)]
[multipathd] SIGUSR1 to SIGHUP for alt thread cancelation

SIGUSR1 was not a good idea after all.

18 years ago[multipathd] race bugs
root [Wed, 20 Jul 2005 07:29:05 +0000 (09:29 +0200)]
[multipathd] race bugs

I was looking at the waitevent thread, and I noticed some issues. Since the
cancellation type is asynchronous, the thread can get cancelled at any
moment. This can cause bugs. For instance, the double removal of the dm task
structure that just got fixed can still show up if the thread were cancelled
after it was freed but before it was set to NULL, there were other issues
like this in update_multpath. It seems like the easiest way to fix this is to
set some defined cancellation points. So that's what this does.

Benjamin Marzinski, Redhat

18 years ago[multipathd] detach threads
root [Wed, 20 Jul 2005 07:23:59 +0000 (09:23 +0200)]
[multipathd] detach threads

since multipathd doesn't ever do pthread_joins, I made the threads
be detached, so that they can completely clean up once they exit. This
probably should get included, to plug a small memory leak.

Benjamin Marzinski, Redhat

18 years ago[multipathd] interim support for reaping DM events waiter threads
root [Wed, 20 Jul 2005 07:21:27 +0000 (09:21 +0200)]
[multipathd] interim support for reaping DM events waiter threads

It is sort of late in the game for redhat to be making kernel patches for the
next release, so here is an alternate way of getting to break out of the
waitevent pthread.

Martin Marzinski, Redhat.

I merge the patch, mainly because some users will get stuck unkowing of
Ed's patch, and it doesn't get in the way when this kernel patch will be
merged.

18 years ago[multipathd] remove the private namespace and callout cache logic
root [Wed, 20 Jul 2005 06:42:20 +0000 (08:42 +0200)]
[multipathd] remove the private namespace and callout cache logic

Because,

1) Martin spoted some rough edges with it and pthread cancelations.
2) It was introduced at a time when path reinstate was done by
   /sbin/multipath, which is not the case anymore.
3) It simplifies the design a fair bit and removes quite a lot of code.

I verified the path reinstate codepath, and it does only 1 dmt allocation
... no callbacks anymore.

18 years ago[libmultipath] get_word() to initialize *word to NULL early
root [Mon, 18 Jul 2005 22:29:55 +0000 (00:29 +0200)]
[libmultipath] get_word() to initialize *word to NULL early

mulitpathd was crashing when I entered an empty line at the CLI prompt,
because the output buffer from get_word was being checked to see if it
was NULL, but get_word never explicitly sets the buffer to NULL if there
is no word.

The patch fixes this.

-Ben Marzinski, Redhat

18 years ago[libmultipath] revert "remove queue_if_no_path for DGC hardware"
root [Fri, 15 Jul 2005 23:00:00 +0000 (01:00 +0200)]
[libmultipath] revert "remove queue_if_no_path for DGC hardware"

My mistake here.  We still need this attribute in order to deal
with the possibility of having a transient period of time during
a ucode upgrade where all paths to a SCSI LU may appear to be
failed.

Edward Goggin, EMC.

18 years ago[multipathd] Ed's Friday assorted fixes
root [Fri, 15 Jul 2005 22:56:34 +0000 (00:56 +0200)]
[multipathd] Ed's Friday assorted fixes

I've found the removal of a multipath map (or all of them for that matter)
to be troublesome for multipathd, particularly its waitevent pthreads.

The dm driver in the kernel was not waking up the dm event waiters so they
stayed in the kernel where each one held a reference on the mapped device
and its table.  This held reference prevented the multipathd from receiving
either a uevent or a hotplug event for the removal of the multipath block
device -- since it is not removed in this case.

--- drivers/md/dm-ioctl.c.orig  2005-07-14 13:33:56.000000000 -0500
+++ drivers/md/dm-ioctl.c       2005-07-14 22:01:04.000000000 -0500
@@ -226,10 +226,22 @@

static void __hash_remove(struct hash_cell *hc)
{
+       struct dm_table *table;
+
/* remove from the dev hash */
list_del(&hc->uuid_list);
list_del(&hc->name_list);
unregister_with_devfs(hc);
+
+ /*
+  * Wakeup any dm event waiters.
+  */
+ table = dm_get_table(hc->md);
+ if (table) {
+ dm_table_event(table);
+ dm_table_put(table);
+ }
+
dm_put(hc->md);
if (hc->new_map)
dm_table_put(hc->new_map);

With dm-ioctl.c patched to wake up waiting dm event threads when a mapped
device is removed, multipathd has issues.  Fixed 3 bugs

(1) update_multipath wasn't dealing with an error from setup_multipath.
Setup_multipath error path involved the call chain
update_multipath_strings->update_multipath_table->
dm_get_map->dm_task_run->ioctl.

Since the mpp structure for a block device could be deallocated in
setup_multipath, the multipathd could SIGSEGV when it referenced the
deallocated mpp memory in update_multipath.

(2) The waitevent pthread's dm task structure memory was getting
destroyed twice if it ever broke out of its waitevent loop due to the call
to waiteventloop returning < 0.  I set wp->dmt to null after waiteventloop
called dm_task_destroy to prevent free_waiter from doing likewise.

(3) setup_multipath was not removing the mpp ptr from the allpaths->mpvec
vector if it deallocated the mpp structure memory due to the error
occurrence mentioned in (1).
This omission would cause multipathd mpvec_garbage_collector to SIGSEGV.
Fixed uev_add_map since it had the same issue.

Edward Goggin, EMC.

18 years ago[prioritizers] alua upgrade
root [Thu, 14 Jul 2005 20:46:22 +0000 (22:46 +0200)]
[prioritizers] alua upgrade

I've got a small update for pp_alua which mainly adds a man page and the
ability to cope with "impatient users" (it can create its own devnode
since udev may not have created one, yet).

Stefan Bader, IBM.

18 years ago[libmultipath] more explicit dm-prereq() output
root [Thu, 14 Jul 2005 20:19:00 +0000 (22:19 +0200)]
[libmultipath] more explicit dm-prereq() output

"prerequisite not met" was just not informative enough, as
proven by the mailing list traffic about that.

18 years ago[libmultipath] remove queue_if_no_path for DGC hardware.
root [Wed, 13 Jul 2005 08:56:08 +0000 (10:56 +0200)]
[libmultipath] remove queue_if_no_path for DGC hardware.

Asked by Edward Goggin, EMC.

18 years ago[libchecker] add pstate_snprintf()
root [Sun, 10 Jul 2005 09:16:06 +0000 (11:16 +0200)]
[libchecker] add pstate_snprintf()

And use it in multipathd and multipath.

18 years ago[multipathd] add header white line to the CLI generic help message
root [Sat, 9 Jul 2005 13:03:48 +0000 (15:03 +0200)]
[multipathd] add header white line to the CLI generic help message

More readable (my opinion)

18 years ago[multipathd] in debug mode, log the pathchecker values for each check
root [Sat, 9 Jul 2005 12:56:21 +0000 (14:56 +0200)]
[multipathd] in debug mode, log the pathchecker values for each check

Somewhat asked by Edward Goggin, EMC

18 years ago[multipath] set an initial value to di_flag in main()
root [Sat, 9 Jul 2005 12:41:43 +0000 (14:41 +0200)]
[multipath] set an initial value to di_flag in main()

Could you initialize di_flag to 0 in main() of multipath/main.c or
else "multipath -l" and "multipath -ll" use a non-deterministic flags
value for path discovery?

Edward Goggin, EMC

19 years ago[libmultipath] possible daemon crash with pp->wwid == 0x0
root [Mon, 4 Jul 2005 07:35:15 +0000 (09:35 +0200)]
[libmultipath] possible daemon crash with pp->wwid == 0x0

It is possible for a path to have its .wwid empty in the daemon pathvec,
causing all sorts of trouble.

In disassemble_map(), update the pp->wwid with mpp->wwid for paths which
may not have been active at the time the getuid callout was run.

Spotted by Edward Goggin, EMC.

19 years ago[multipath] '-l' to never report checker state
root [Mon, 4 Jul 2005 07:28:24 +0000 (09:28 +0200)]
[multipath] '-l' to never report checker state

Makes for a more consistent output.
Asked by Edward Goggin, EMC.

19 years ago[multipathd] Debian specific compilation error, pthread related
root [Fri, 1 Jul 2005 18:59:53 +0000 (20:59 +0200)]
[multipathd] Debian specific compilation error, pthread related

Move the locking out of upate_multipath(), up to its caller.

19 years ago[multipathd] memory and threading audit
root [Fri, 1 Jul 2005 15:30:08 +0000 (17:30 +0200)]
[multipathd] memory and threading audit

Some leaks plugged.

Still, there is one left.
You can trigger it by submitting successive "add map $map" command to
the CLI. Each time RSS/VSZ take 32 units more.

Please help on this one.

19 years agoTame warning when compiling with _DEBUG_
root [Thu, 30 Jun 2005 09:38:57 +0000 (11:38 +0200)]
Tame warning when compiling with _DEBUG_

All about uncasted MALLOC()s when it is defined to dbg_malloc().

19 years ago[multipathd] don't free unallocated mem in cli.c
root [Thu, 30 Jun 2005 09:12:43 +0000 (11:12 +0200)]
[multipathd] don't free unallocated mem in cli.c

RHEL4 really doesn't like it.

19 years ago[multipathd] -lreadline needs -lcurses
root [Thu, 30 Jun 2005 09:11:10 +0000 (11:11 +0200)]
[multipathd] -lreadline needs -lcurses

well on RHEL4 at least.
So add it to the LDFLAGS

19 years ago[multipathd] merge a more versatile CLI parser
root [Wed, 29 Jun 2005 14:18:30 +0000 (16:18 +0200)]
[multipathd] merge a more versatile CLI parser

Synthax moved to :

 list paths
 list maps
 add path $path
 remove|del path $path
 add map $map
 remove|del map $map
 switch|switchgroup map $map group $group

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.