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

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

18 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.

18 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.