platform/upstream/multipath-tools.git
18 years ago[multipathd] 'show maps xxx' CLI tweaks
Christophe Varoqui [Mon, 2 Jan 2006 10:24:16 +0000 (11:24 +0100)]
[multipathd] 'show maps xxx' CLI tweaks

o rename PRINT_MAP_FAILBACK to PRINT_MAP_STATUS
o 'print maps' command renamed to 'print maps status'
o 'print maps' now use the PRINT_MAP_NAMES layout, ie name|dm_name|wwid
o remove the dm_name field from PRINT_MAP_STATUS and PRINT_MAP_STATS

18 years ago[libmultipath] hardware defaults framework overhaul
Christophe Varoqui [Mon, 19 Dec 2005 14:48:41 +0000 (15:48 +0100)]
[libmultipath] hardware defaults framework overhaul

- Access to all "struct hwentry" parameters
- Removes old store_hwe{_ext} functions
- Remove unused selector_args param in all config.h structs
- Add hardware family maintainership banner, and pre-populate
- Move hardcoded minio in a defaults.h:DEFAULT_MINIO define

Please verify I didn't mess the defaults for hardware you care about,
and start claiming maintainership.

18 years ago[multipathd] remove unused variable
Christophe Varoqui [Mon, 19 Dec 2005 09:26:31 +0000 (10:26 +0100)]
[multipathd] remove unused variable

18 years ago[multipathd] "multipath" is a "map" synonym
Christophe Varoqui [Mon, 19 Dec 2005 09:25:08 +0000 (10:25 +0100)]
[multipathd] "multipath" is a "map" synonym

Like "multipaths" is a "maps" synonym

18 years ago[multipathd] convert another user to find_mp_by_str()
Christophe Varoqui [Sun, 18 Dec 2005 10:53:01 +0000 (11:53 +0100)]
[multipathd] convert another user to find_mp_by_str()

18 years ago[multipathd] add "show map $map topo" CLI command
Christophe Varoqui [Sun, 18 Dec 2005 10:46:43 +0000 (11:46 +0100)]
[multipathd] add "show map $map topo" CLI command

multipathd> sho map dm-1 topo
mpath0 (149455400000000000000000000000000d00600000b000000)
[size=67 GB][features=1 queue_if_no_path][hwhandler=0]
\_ round-robin 0 [prio=10][enabled]
 \_ 3:0:0:1 sdb 8:16 [active][ready]
\_ round-robin 0 [prio=6][enabled]
 \_ 4:0:0:1 sde 8:64 [active][ready]

and :

multipathd> sho map mpath0 topo
mpath0 (149455400000000000000000000000000d00600000b000000)
[size=67 GB][features=1 queue_if_no_path][hwhandler=0]
\_ round-robin 0 [prio=0][enabled]
 \_ 3:0:0:1 sdb 8:16 [active][ready]
\_ round-robin 0 [prio=0][enabled]
 \_ 4:0:0:1 sde 8:64 [active][ready]

18 years ago[multipathd] allow shortcut in CLI syntax
Christophe Varoqui [Fri, 16 Dec 2005 21:07:13 +0000 (22:07 +0100)]
[multipathd] allow shortcut in CLI syntax

For example "li maps topo" is allowed and synonymous of "list maps
topology".

18 years ago[multipathd] change last CLI command syntax
Christophe Varoqui [Fri, 16 Dec 2005 20:48:37 +0000 (21:48 +0100)]
[multipathd] change last CLI command syntax

"show multipaths" was confusing because "show maps" looks so awfuly close.

Now :
1) "multipaths" is a "maps" synomym
2) "show multipaths topology" shows what "show multipaths" did

There is a bit of function naming sanitizing in the lib too.

18 years ago[libmultipath] tweaks for IBM / SGI common hardware
Christophe Varoqui [Tue, 13 Dec 2005 13:46:53 +0000 (14:46 +0100)]
[libmultipath] tweaks for IBM / SGI common hardware

here's a small update for the hardware table.

I've added a new controller (IBM DS4100), which uses the same controller
than SGI TPC. For a proper support I had to relax the checks in pp_tpc
slightly.

Secondly, it sets the FAILBACK for all machines supported by pp_tpc to
-FAILBACK_IMMEDIATE, as we cannot (yet) adjust the path setting. Hence
we need to switch back to the preferred path as soon as it becomes
available again.

Hannes Reinecke, Suse

18 years ago[build] Makefile cleanup
Christophe Varoqui [Fri, 9 Dec 2005 16:02:27 +0000 (17:02 +0100)]
[build] Makefile cleanup

Fixup CFLAGS so that it can be adjusted by setting 'OPTFLAGS'
from the commandline.
General cleanup of Makefiles; move common parts into Makefile.inc.

Signed-off-by: Hannes Reinecke <hare@suse.de>
18 years ago[devmapper] Compilation fixes
Christophe Varoqui [Fri, 9 Dec 2005 15:59:57 +0000 (16:59 +0100)]
[devmapper] Compilation fixes

As we're returning a strdup()ed string from dm_mapname() it hardly
qualifies as 'const'.

Signed-off-by: Hannes Reinecke <hare@suse.de>
18 years ago[kpartx] Add suport for S/390 ECKD DASD
Christophe Varoqui [Fri, 9 Dec 2005 15:58:53 +0000 (16:58 +0100)]
[kpartx] Add suport for S/390 ECKD DASD

This patch adds support for S/390 ECKD DASD partition tables.

Signed-off-by: Hannes Reinecke <hare@suse.de>
18 years ago[devmapper] Check mapname length
Christophe Varoqui [Fri, 9 Dec 2005 15:54:48 +0000 (16:54 +0100)]
[devmapper] Check mapname length

dm_task_get_name might return a zero-length string, which also
seem to indicate an invalid mapname. Fix dm_mapname() to always
return NULL if either no mapname or an zero-length mapname
was returned.

Signed-off-by: Hannes Reinecke <hare@suse.de>
18 years ago[multipathd] add "show multipaths" CLI command
Christophe Varoqui [Fri, 9 Dec 2005 15:40:53 +0000 (16:40 +0100)]
[multipathd] add "show multipaths" CLI command

Mimics the 'multipath -ll' output in the CLI.

18 years ago[libmultipath] groundwork to share print_mp() between multipath & deamon
Christophe Varoqui [Fri, 9 Dec 2005 15:39:10 +0000 (16:39 +0100)]
[libmultipath] groundwork to share print_mp() between multipath & deamon

Introduce snprint_mp() and teach print_mp() to use it.

print_mp() uses a 64 lines buffer, which mean multipath(8) can only
print 62 "paths or pathgroup". Daemon will use the buffer doubling
trick to work around that.

You are allowed to report your unhappiness about this default :/

18 years ago[kpartx] use lseek64 instead of self-defined syscall
Christophe Varoqui [Wed, 7 Dec 2005 22:54:04 +0000 (23:54 +0100)]
[kpartx] use lseek64 instead of self-defined syscall

Hannes Reinecke, Suse

18 years ago[priority] new prioritizer for some SGI hardware (take 2)
Christophe Varoqui [Wed, 7 Dec 2005 22:40:41 +0000 (23:40 +0100)]
[priority] new prioritizer for some SGI hardware (take 2)

Add to files for real.

Hannes Reinecke, Suse

18 years ago[libmultipath] add DASD discovery profile
Christophe Varoqui [Wed, 7 Dec 2005 22:39:01 +0000 (23:39 +0100)]
[libmultipath] add DASD discovery profile

Make DASD fits the vendor/product scsi-ism the tools use to
index its hardware table.

Hannes Reinecke, Suse

18 years ago[multipathd] adjust oom_adj to the 2.6.14 standards
Christophe Varoqui [Wed, 7 Dec 2005 22:29:38 +0000 (23:29 +0100)]
[multipathd] adjust oom_adj to the 2.6.14 standards

As of 2.6.14, the kernel will only accept oom_adj values of > -17.
Writing '-17' into oom_adj will be ignored. This patch fixes the
value to -16.

Hannes Reinecke, Suse

18 years ago[libmultipath] SGI hardware defaults tuning
Christophe Varoqui [Wed, 7 Dec 2005 22:23:32 +0000 (23:23 +0100)]
[libmultipath] SGI hardware defaults tuning

Switch TPs to GROUP_BY_PRIO now that we have a priority checker

That enables multiple paths to the prefered array port to
be grouped together and load-balanced. I'll do that and see if users get
annoyed.

Suggested by Hannes Reinecke, Suse

18 years ago[libmultipath] add some IBM hardware defaults
Christophe Varoqui [Wed, 7 Dec 2005 14:23:55 +0000 (15:23 +0100)]
[libmultipath] add some IBM hardware defaults

Hannes Reinecke, Suse

18 years ago[priority] new prioritizer for some SGI hardware
Christophe Varoqui [Wed, 7 Dec 2005 14:23:06 +0000 (15:23 +0100)]
[priority] new prioritizer for some SGI hardware

Hannes Reinecke, Suse

18 years ago[kpartx] bug fixes for dos extended partition [4/4]
Christophe Varoqui [Thu, 1 Dec 2005 20:58:49 +0000 (21:58 +0100)]
[kpartx] bug fixes for dos extended partition [4/4]

There is meaninglessly duplicated code in read_dos_pt().
It should be safe to remove it.

un'ichi "Nick" Nomura, NEC

18 years ago[kpartx] bug fixes for dos extended partition [3/4]
Christophe Varoqui [Thu, 1 Dec 2005 20:57:29 +0000 (21:57 +0100)]
[kpartx] bug fixes for dos extended partition [3/4]

in the for loop in read_extended_partition,
'here' is updated if the next extended partition is found.

However, the 'here' value should be updated in the next while loop.
Otherwise it's possible that following partition table
entry refers updated value and generate wrong mapping.

I'm not sure if there is any partitioning tool which can generate
such table. But it's safer to fix this.

Jun'ichi Nomura, NEC

18 years ago[kpartx] bug fixes for dos extended partition [2/4]
Christophe Varoqui [Thu, 1 Dec 2005 20:54:15 +0000 (21:54 +0100)]
[kpartx] bug fixes for dos extended partition [2/4]

kpartx usually doesn't create a mapping for extended partition.
However, it does if it's empty.
It's harmless but not consistent.
Attached patch makes it consistent by not creating a mapping
even when the extended partition is empty.

Please consider to apply.

If you have logical partitions in extended partition:
# parted /dev/sdc p
Disk geometry for /dev/sdc: 0.000-34686.000 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          7.844     31.376  extended
5          7.875     23.532  logical

No mapping is created for extended partition:
# dmsetup table|grep sdc|sort
  sdc5: 0 32067 linear 8:32 16128

However, if the extended partition is empty:
# parted /dev/sdc p
Disk geometry for /dev/sdc: 0.000-34686.000 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          7.844     31.376  extended

The following mapping is created:
# dmsetup table|grep sdc|sort
  sdc1: 0 48195 linear 8:32 16065

Jun'ichi Nomura, NEC

18 years ago[kpartx] bug fixes for dos extended partition [1/4]
Christophe Varoqui [Thu, 1 Dec 2005 20:50:27 +0000 (21:50 +0100)]
[kpartx] bug fixes for dos extended partition [1/4]

the latest kpartx generates wrong mapping for
MS-DOS extended partitions.
Attached patch fixes the problem.
Please consider to apply.

Consider you created the following partition table.
# parted /dev/sdc p
Disk geometry for /dev/sdc: 0.000-34686.000 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
  1          0.031      7.844  primary
  2          7.844     31.376  extended
  5          7.875     23.532  logical
  6         23.563     31.376  logical

kpartx should generate the following mappings:
# dmsetup table|grep sdc|sort
  sdc1: 0 16002 linear 8:32 63
  sdc5: 0 32067 linear 8:32 16128
  sdc6: 0 16002 linear 8:32 48258

However, actually it generates:
# dmsetup table|grep sdc|sort
  sdc1: 0 16002 linear 8:32 63
  sdc5: 0 32067 linear 8:32 16128
  sdc6: 0 16065 linear 8:32 80325
  sdc7: 0 16002 linear 8:32 48258

Jun'ichi Nomura, NEC

18 years ago[multipathd] move show_{paths,maps} in cli_handlers.c
Christophe Varoqui [Wed, 30 Nov 2005 08:52:12 +0000 (09:52 +0100)]
[multipathd] move show_{paths,maps} in cli_handlers.c

Near their users.

18 years ago[libmultipath] remove remnents of the old print padding framework
Christophe Varoqui [Tue, 29 Nov 2005 17:01:05 +0000 (18:01 +0100)]
[libmultipath] remove remnents of the old print padding framework

18 years ago[libmultipath] extend the printing framework
Christophe Varoqui [Tue, 29 Nov 2005 16:35:33 +0000 (17:35 +0100)]
[libmultipath] extend the printing framework

- for pathgroup information printing
- for print_mp() start of integration

18 years ago[libmultipath] sysfs_get_size() returning 0 is not necessarily an error
Christophe Varoqui [Tue, 29 Nov 2005 14:14:49 +0000 (15:14 +0100)]
[libmultipath] sysfs_get_size() returning 0 is not necessarily an error

0-sized devices exist in real life but sysfs_get_size() returns 0 on
errors.

Current behaviour cascade the failure in :

- sysfs_get_size
- up to sysfs_pathinfo
- up to pathinfo
- up to discovery

Not fair at all.

So feed the &size as sysfs_get_size() parameter and use the return code
only to report status to caller.

Noted by Maxim Kozover

18 years ago[libmultipath] remove math lib dependency
Christophe Varoqui [Tue, 29 Nov 2005 10:08:39 +0000 (11:08 +0100)]
[libmultipath] remove math lib dependency

The new printing framework does not need the math lib anymore.
So remove it from the includes and Makefiles.

18 years ago[libmultipath] drop the path cache
Christophe Varoqui [Tue, 29 Nov 2005 10:05:08 +0000 (11:05 +0100)]
[libmultipath] drop the path cache

- remove the cache library files
- remove the cache loading in multipath
- remove the "dump pathvec" facility in multipathd
- remove a small cache assertion in the discovery

18 years ago[libmultipath] max column size incorrectly trimed to 32 in previous patch
Christophe Varoqui [Tue, 29 Nov 2005 08:55:41 +0000 (09:55 +0100)]
[libmultipath] max column size incorrectly trimed to 32 in previous patch

Set it back to 64 to enable display of full wwid fields.

18 years ago[libmultipath] fix multipath renaming
Christophe Varoqui [Mon, 28 Nov 2005 16:15:59 +0000 (17:15 +0100)]
[libmultipath] fix multipath renaming

This handles a rename from within multipath
now only via multipath.conf file.

Edward Goggin, EMC

18 years ago[libmultipath] extensible padded printing framework
Christophe Varoqui [Mon, 28 Nov 2005 13:53:23 +0000 (14:53 +0100)]
[libmultipath] extensible padded printing framework

And decrement author shame counter :/

18 years ago[multipathd] add "show maps stats" CLI command
Christophe Varoqui [Mon, 28 Nov 2005 08:38:09 +0000 (09:38 +0100)]
[multipathd] add "show maps stats" CLI command

xa-s05:~# multipathd -k"show maps stats"
name   sysfs path_fails switch_grp map_loads total_q_time q_tmo
mpath0 dm-0  1          4424       2         0            0
mpath1 dm-1  0          13717      2         0            0

18 years ago[libmultipath] log-friendly version of print_mp() in domap()
Christophe Varoqui [Thu, 24 Nov 2005 17:06:06 +0000 (18:06 +0100)]
[libmultipath] log-friendly version of print_mp() in domap()

Seeing this in log files is not nice :

mpath1 (149455400000000000000000000000000d20600000b000000)
[size=33 GB][features="1 queue_if_no_path"][hwhandler="0"]
\_ round-robin 0 [enabled]
  \_ 8:0:0:2  sdc 8:32  [active][undef]
\_ round-robin 0 [enabled]
  \_ 9:0:0:2  sde 8:64  [active][undef]
\_ round-robin 0 [enabled]
  \_ 10:0:0:2 sdg 8:96  [active][undef]
\_ round-robin 0 [active]
  \_ 6:0:0:2  sdl 8:176 [active][undef]

Let's rather print this :

Nov 24 18:05:38 | mpath1: load table [0 71122560 multipath 0 0 4 1
round-robin 0 1 1 8:32 100 round-robin 0 1 1 8:64 100 round-robin 0 1 1
8:96 100 round-robin 0 1 1 8:176 100]

18 years ago[multipathd] make clear in the logs what triggered an action
Christophe Varoqui [Thu, 24 Nov 2005 16:43:53 +0000 (17:43 +0100)]
[multipathd] make clear in the logs what triggered an action

Nov 24 17:37:58 | mpath0: event checker started
Nov 24 17:37:58 | mpath1: event checker started
Nov 24 17:37:58 | path checkers start up
Nov 24 17:38:08 | sdb: add path (uevent)
Nov 24 17:38:08 | 8:16: ownership set to mpath0
Nov 24 17:38:08 | sdc: add path (uevent)
Nov 24 17:38:08 | 8:32: ownership set to mpath1
Nov 24 17:38:23 | mpath1: switch to path group #1
Nov 24 17:39:21 | mpath1: switch to path group #2 (operator)
Nov 24 17:39:36 | mpath1: switch to path group #1
Nov 24 17:39:39 | mpath0: switch to path group #2
Nov 24 17:39:42 | sdb: remove path (operator)
Nov 24 17:39:47 | mpath1: switch to path group #2
Nov 24 17:40:15 | mpath1: switch to path group #1
Nov 24 17:40:50 | sdb: remove path (uevent)
Nov 24 17:40:50 | sdb: spurious uevent, path not in pathvec
Nov 24 17:40:50 | uevent trigger error
Nov 24 17:41:03 | sdb: add path (uevent)
Nov 24 17:41:04 | 8:16: ownership set to mpath0

18 years ago[libmultipath] log the date in "multipathd -d" output
Christophe Varoqui [Thu, 24 Nov 2005 14:27:09 +0000 (15:27 +0100)]
[libmultipath] log the date in "multipathd -d" output

xa-s05:~/scm/multipath-tools-0.4.7# multipathd/multipathd -d
Nov 24 15:22:18 | mpath0: event checker started
Nov 24 15:22:18 | mpath1: event checker started
Nov 24 15:22:18 | path checkers start up
Nov 24 15:22:18 | mpath1: switch to path group #1
Nov 24 15:22:52 | mpath0: switch to path group #4
Nov 24 15:23:00 | mpath1: switch to path group #3

18 years ago[multipathd] remove the retry login in uev_remove_path()
Christophe Varoqui [Thu, 24 Nov 2005 11:09:58 +0000 (12:09 +0100)]
[multipathd] remove the retry login in uev_remove_path()

The last uev_remove_path() should succeed since in addition to
removing from the map the path being removed by the uevent, it will
also remove all paths found in the current map which do not appear
in pathvec.

This avoids long delays due to path verifying in the old code.

Edward Goggin, EMC

18 years ago[multipathd] "add/del map" to keep the DM in sync
Christophe Varoqui [Wed, 23 Nov 2005 17:03:28 +0000 (18:03 +0100)]
[multipathd] "add/del map" to keep the DM in sync

The reach that goal, the following changes were applied :

- call dm_lib_release() after each map creation/deletion
- coalesce_paths() new refwwid parameter to do scope-limiting
- flush_map() didn't really need the devname parameter, remove
- uev_{add,remove}_map extended to manipulate DM maps
- trap devmap umount events to try a little house-keeping
  (For testing. Might be removed latter)

18 years ago[libmultipath] move get_refwwid() to libmultipath/configure.c
Christophe Varoqui [Wed, 23 Nov 2005 13:47:50 +0000 (14:47 +0100)]
[libmultipath] move get_refwwid() to libmultipath/configure.c

And pass "dev" and "dev_type" as params
to make it usable from multipathd.

18 years ago[multipathd] discarding an event is not an error
Christophe Varoqui [Wed, 23 Nov 2005 09:57:46 +0000 (10:57 +0100)]
[multipathd] discarding an event is not an error

This avoids sending misleading "uxtrigger error" messages.

18 years ago[libmultipath] fix non-daemon build
Christophe Varoqui [Wed, 23 Nov 2005 00:45:35 +0000 (01:45 +0100)]
[libmultipath] fix non-daemon build

The waiting logic in sysfs_get_bus() does not matter for multipath(8).
Pre-process it out.

18 years ago[libmultipath] move messages from crit to warn in domap()
Christophe Varoqui [Wed, 23 Nov 2005 00:42:18 +0000 (01:42 +0100)]
[libmultipath] move messages from crit to warn in domap()

Edward Goggin, EMC

18 years ago[libmultipath] discovery too fast for sysfs_get_bus
Christophe Varoqui [Wed, 23 Nov 2005 00:38:38 +0000 (01:38 +0100)]
[libmultipath] discovery too fast for sysfs_get_bus

discovery.c:sysfs_get_bus() is unreliable in the following code path :

uev_add_path
-> store_pathinfo
-> pathinfo

Example trace :

### sdb: sdev = 539720
### sdb: attr_path = /sys/block/sdb/device
### sdb: attr_buff = /sys/devices/platform/host3/target3:0:0/3:0:0:1
### sdb: sdev->bus =

For whatever reason sysfs_open_device_path() can silently fails to
produce a usable ->bus.

As a consequence,
pp->hwe is NULL
-> mpp->hwe inherits this pp->hwe == NULL through add_map_with_path
-> the prop selectors fails to detect hardware settings

So this patch adds a sleep there.

18 years ago[multipath] resurect the rules file
Christophe Varoqui [Tue, 22 Nov 2005 22:02:48 +0000 (23:02 +0100)]
[multipath] resurect the rules file

I overlooked the fact we still need the rules file to handle the
partitions through kpartx.

So revert 3872743f0b2479b0450368e56a664583821bc5a3, but remove the
multipath(8) trigger from the rules file.

18 years ago[multipathd] more symmetry in lock/unlock macro usage
Christophe Varoqui [Tue, 22 Nov 2005 13:17:47 +0000 (14:17 +0100)]
[multipathd] more symmetry in lock/unlock macro usage

Edward Goggin, EMC

18 years ago[multipathd] use DM rename instead of a remove/create cycle
Christophe Varoqui [Tue, 22 Nov 2005 13:16:13 +0000 (14:16 +0100)]
[multipathd] use DM rename instead of a remove/create cycle

This patch depends on a kernel patch yet to be merged. Beware.

Also fixed callers of dm_info() to check for <=0 as an error instead of
just == 0.

Edward Goggin, EMC.

18 years ago[libmultipath] DCG hardware defaults do not apply to "LUN_Z"
Christophe Varoqui [Tue, 22 Nov 2005 11:13:34 +0000 (12:13 +0100)]
[libmultipath] DCG hardware defaults do not apply to "LUN_Z"

18 years ago[libmultipath] don't switchgroup on map create in multipathd
Christophe Varoqui [Tue, 22 Nov 2005 10:56:04 +0000 (11:56 +0100)]
[libmultipath] don't switchgroup on map create in multipathd

Keep the old behaviour for multipath(8)

18 years ago[libmultipath] remove redondant and wrong adopt_paths in setup_multipath
Christophe Varoqui [Mon, 21 Nov 2005 23:00:53 +0000 (00:00 +0100)]
[libmultipath] remove redondant and wrong adopt_paths in setup_multipath

This caused already loaded maps to disappear at daemon startup.

18 years ago[build] legacy files update
Christophe Varoqui [Mon, 21 Nov 2005 21:46:33 +0000 (22:46 +0100)]
[build] legacy files update

- ChangeLog purged, now points to the web
- README was too outdated to live
- FAQ points to the web

18 years ago[build] remove the udev rules file handling
Christophe Varoqui [Mon, 21 Nov 2005 17:02:05 +0000 (18:02 +0100)]
[build] remove the udev rules file handling

18 years ago[multipathd] DM configuration final cut
Christophe Varoqui [Mon, 21 Nov 2005 17:00:03 +0000 (18:00 +0100)]
[multipathd] DM configuration final cut

This one adds the multipath maintenance through uevents {add,remove} path
handlers.

Edward Goggin, EMC.

18 years ago[multipathd] DM configuration ground work #2
Christophe Varoqui [Mon, 21 Nov 2005 16:25:25 +0000 (17:25 +0100)]
[multipathd] DM configuration ground work #2

This patch enables DM configuration at multipathd startup.

To achieve that simple goal, the following steps were necessary :

- new libmultipath/structs_vec.[ch] exporting high level method working
  on [vectored] {path,multipath} structs :
- set_no_path_retry
- adopt_paths
- orphan_paths
- orphan_path
- verify_paths
- update_mpp_paths
- setup_multipath
- update_multipath_strings
- remove_map
- stop_waiter_thread_func *stop_waiter, int purge_vec);
- remove_maps
- add_map_without_path
- add_map_with_path
- teach coalesce_path() to use add_map_with_path() and verify_paths()
- add a configure() function to the daemon
- teach multipathd to coalesce its map vector after configuration
- multipathd/main.c:reconfigure() restarts the configuration process

Fixed 2 bugs in the implementation from Edward Goggin :

- set mpp wwid before the binded alias lookup so that friendly names
  work
- allocate a mpp->paths in adopt_paths() when mpp->pg is NULL and we
  must store a path there

And fixed one long standing careless bug in all structs.c:find_*().
Being passed a NULL vector shortcuts the lookups now.

18 years ago[multipathd] DM configuration ground work
Christophe Varoqui [Mon, 21 Nov 2005 11:25:49 +0000 (12:25 +0100)]
[multipathd] DM configuration ground work

- introduce update_mpp_paths() to refresh mpp->paths out of mpp->pg
- fix 2 segfault in uev_{add,del}_path logging in error paths
- split add_map_without_path() out of uev_add_map()
- adopt_paths() to take a pathvec as 1st param instead of a full "vecs"
- select round robin weights in setup_multipath()
- uev_add_map to return if map is already registered instead of the purge
  plus re-register cycle

18 years ago[multipathd] add logs in waiteventloop() error paths
Christophe Varoqui [Mon, 21 Nov 2005 10:05:48 +0000 (11:05 +0100)]
[multipathd] add logs in waiteventloop() error paths

Also renames unblock_sighup to unblock_signals, as it now unblocks
sighup *and* sigusr1

18 years ago[multipathd] use SIGUSR1 to reap waiters and reconfigure upon SIGHUP
Christophe Varoqui [Mon, 21 Nov 2005 09:40:48 +0000 (10:40 +0100)]
[multipathd] use SIGUSR1 to reap waiters and reconfigure upon SIGHUP

Edward Goggin, EMC

18 years ago[multipathd] more flexible remove_map()
Christophe Varoqui [Mon, 21 Nov 2005 09:25:54 +0000 (10:25 +0100)]
[multipathd] more flexible remove_map()

Add two params to remove_map() :

- a function pointer to a waiter thread stop method
  NULL if you don't want to stop it (or know it is already down)
- an int purge_vec, to control the multipath vector maintenance

Also remove a superfluous block in stop_waiter_thread()

Mostly from the Edward Goggin, EMC, patch-chest.

18 years ago[libmultipath] coalesce_path() skips 0-sized paths
Christophe Varoqui [Thu, 17 Nov 2005 21:21:04 +0000 (22:21 +0100)]
[libmultipath] coalesce_path() skips 0-sized paths

These paths can appears in pathvec now that disassemble_map() stores
the paths in pathvec in addition to mpp->pg.

18 years ago[libmultipath] fix pathcount wildcard
Christophe Varoqui [Thu, 17 Nov 2005 16:49:13 +0000 (17:49 +0100)]
[libmultipath] fix pathcount wildcard

18 years ago[libmultipath] uevent asynchronous processing
Christophe Varoqui [Thu, 17 Nov 2005 16:41:11 +0000 (17:41 +0100)]
[libmultipath] uevent asynchronous processing

I think block add/remove uevents are getting lost because (1) there is but
a single multipathd thread responsible for servicing these uevents and (2)
the service time for a single uevent can be quite long.  While not
foolproof, as long the netlink uevent socket uses unreliable datagrams, I
implemented a "more complete" solution for this problem by using a queue
for received, but not yet processed uevents in the multipathd and allocated
another thread for servicing this queue.

This approach will allow the uevent_listen thread to simply queue a request
before returning to retrieve more uevents.  While this queue could get
quite large, at least it will not be limited to the constraints imposed by
the Linux kernel's maximum socket receive buffer size.

Edward Goggin, EMC

18 years ago[libmultipath] pathcount(mpp, PATH_WILD) counts paths in any state
Christophe Varoqui [Thu, 17 Nov 2005 16:38:31 +0000 (17:38 +0100)]
[libmultipath] pathcount(mpp, PATH_WILD) counts paths in any state

18 years ago[libmultipath] move coalesce_path() to libmultipath/configure.c
Christophe Varoqui [Thu, 17 Nov 2005 15:50:43 +0000 (16:50 +0100)]
[libmultipath] move coalesce_path() to libmultipath/configure.c

and consequences ...

- coalesce_paths() and all functions used only in this code path are
  folded into configure.c
- move print_*() to libmultipath/print.c, although they are only needed
  for multipath(8) (in their current form)
- declare {map,path}_layout as globals in print.c so we can now remove
  them from the parameter list in all print.c-exported functions

Now we can use coalesce_path() from multipathd.

18 years ago[multipathd] rename init_paths() to init_vecs()
Christophe Varoqui [Thu, 17 Nov 2005 13:43:04 +0000 (14:43 +0100)]
[multipathd] rename init_paths() to init_vecs()

Resync with the function real action.
From Edward Goggin patch-chest.

18 years ago[multipathd] release libdevmapper ressources on exit path
Christophe Varoqui [Thu, 17 Nov 2005 13:39:13 +0000 (14:39 +0100)]
[multipathd] release libdevmapper ressources on exit path

18 years ago[build] add the netapp prioritizer in the spec file
Christophe Varoqui [Thu, 17 Nov 2005 13:31:38 +0000 (14:31 +0100)]
[build] add the netapp prioritizer in the spec file

18 years ago[libmultipath] split free_multipath_attributes() out of free_multipath()
Christophe Varoqui [Thu, 17 Nov 2005 13:29:06 +0000 (14:29 +0100)]
[libmultipath] split free_multipath_attributes() out of free_multipath()

Code factorization in update_multipath_strings()
From Edward Goggin, EMC, patch-chest

18 years ago[libmultipath] move pathcount() to libmultipath/structs.c
Christophe Varoqui [Thu, 17 Nov 2005 11:06:03 +0000 (12:06 +0100)]
[libmultipath] move pathcount() to libmultipath/structs.c

Edward Goggin proposed to move it.
Agreed, though I prefer to put it here.

18 years ago[libmultipath] store the pgpolicy function pointer in struct multipath
Christophe Varoqui [Thu, 17 Nov 2005 10:51:15 +0000 (11:51 +0100)]
[libmultipath] store the pgpolicy function pointer in struct multipath

- setup the pointer in libmultipath/propsel.c:select_pgpolicy
- use in multipath/main.c:setup_map()

Edward Goggin, EMC, patch-chest

18 years ago[libmultipath] failback mode definition fix in hwtable
Christophe Varoqui [Thu, 17 Nov 2005 09:48:26 +0000 (10:48 +0100)]
[libmultipath] failback mode definition fix in hwtable

FAILBACK_* are negative.

Edward Goggin, EMC

18 years ago[libmultipath] disassemble_map to store undiscovered path in pathvec too
Christophe Varoqui [Thu, 17 Nov 2005 09:43:30 +0000 (10:43 +0100)]
[libmultipath] disassemble_map to store undiscovered path in pathvec too

Edward Goggin, EMC

18 years ago[libmultipath] move assemble_map() in libmultipath/dmparser.c
Christophe Varoqui [Thu, 17 Nov 2005 09:34:23 +0000 (10:34 +0100)]
[libmultipath] move assemble_map() in libmultipath/dmparser.c

Now it rests near its sister-function disassemble_map().

Edward Goggin, EMC

18 years ago[libmultipath] extend the scope of the "rr_min_io" keyword to hwe and mpe
Christophe Varoqui [Wed, 16 Nov 2005 16:24:48 +0000 (17:24 +0100)]
[libmultipath] extend the scope of the "rr_min_io" keyword to hwe and mpe

Can now specify per device instance or device type rr repeat counts in
the config file.

Edward Goggin, EMC, and me.

18 years ago[libmultipath] don't re-select the getprio fn when not needed
Christophe Varoqui [Wed, 16 Nov 2005 15:26:10 +0000 (16:26 +0100)]
[libmultipath] don't re-select the getprio fn when not needed

The pp->getprio was used
1) to store the prioritizer function pointer
2) to determine if the prioritizer was already selected

But NULL is a valid value for already selected getprio.
Which causes uneeded re-selection.

So introduce a pp->getprio_selected flag to straight this out.

Edward Goggin, EMC

18 years ago[multipath] sysfs_get_bus() should return an int
Christophe Varoqui [Wed, 16 Nov 2005 14:19:48 +0000 (15:19 +0100)]
[multipath] sysfs_get_bus() should return an int

18 years ago[multipathd] print "immediate" as failback val in "show maps" cli command
Christophe Varoqui [Wed, 16 Nov 2005 09:49:20 +0000 (10:49 +0100)]
[multipathd] print "immediate" as failback val in "show maps" cli command

Edward Goggin, EMC

18 years ago[multipathd] find_mp_by_minor() fix
Christophe Varoqui [Wed, 16 Nov 2005 09:27:21 +0000 (10:27 +0100)]
[multipathd] find_mp_by_minor() fix

Do not refer to variable mpp before it is set.

Edward Goggin, EMC

18 years ago[multipathd] path group priority calculation fix
Christophe Varoqui [Wed, 16 Nov 2005 09:23:28 +0000 (10:23 +0100)]
[multipathd] path group priority calculation fix

Used local variable to tally path group priority in select_path_group
since the current code uses an accumulative algorithm thereby increasing
the path groups priority every time this function is called.

Edward Goggin, EMC

18 years ago[multipathd] show maps/paths to grow its output buffer
Christophe Varoqui [Wed, 16 Nov 2005 09:14:58 +0000 (10:14 +0100)]
[multipathd] show maps/paths to grow its output buffer

Thus adapt to large setups needs : Up to or greater than a 8,500 byte
buffer to handle 140 paths spread over 35 maps.

Edward Goggin, EMC

18 years ago[multipathd] set the netlink uevent socket's rcv buf to 262,142
Christophe Varoqui [Wed, 16 Nov 2005 08:57:04 +0000 (09:57 +0100)]
[multipathd] set the netlink uevent socket's rcv buf to 262,142

Doing so will help avoid dropping uevents during the time that the
listen pthread does not have a receive buffer posted.

Edward Goggin, EMC

18 years ago[multipathd] superfluous unlock() in uevent discard code path
Christophe Varoqui [Wed, 16 Nov 2005 08:43:38 +0000 (09:43 +0100)]
[multipathd] superfluous unlock() in uevent discard code path

Removed.
Found and fixed by Edward Goggin, EMC

18 years ago[multipathd] fix a segv in enable_group()
Christophe Varoqui [Wed, 16 Nov 2005 08:29:44 +0000 (09:29 +0100)]
[multipathd] fix a segv in enable_group()

pp->mpp->pg should not be NULL when entering enable_group().
Failing update_multipath_strings() can  lead to such a situation.
So check its return value and abord early.

18 years ago[multipath] fill in the wwid field for path discovered by the map parser
Christophe Varoqui [Tue, 15 Nov 2005 14:38:48 +0000 (15:38 +0100)]
[multipath] fill in the wwid field for path discovered by the map parser

There is a false assumption in the involved code path :

- the devmap parser adds paths to the vector and fills only the dev_t field
- update_paths() fills the rest but assumes that the wwid is already set
  by the parser. It could have, as the map uuid is available, but it did
  not because we can't trust the map.

So teach update_paths() to refresh the wwid too.

18 years ago[priority] new NetApp prioritizer small fixes
Christophe Varoqui [Tue, 15 Nov 2005 09:52:55 +0000 (10:52 +0100)]
[priority] new NetApp prioritizer small fixes

- tame build warnings about uncasted string in strncmp and strlen
- add the FAILBACK_UNDEF default field in hwtable

18 years ago[priority] new NetApp prioritizer
Christophe Varoqui [Tue, 15 Nov 2005 09:43:40 +0000 (10:43 +0100)]
[priority] new NetApp prioritizer

Dave Wysochanski, NetApp

18 years ago[legal] seed the copyright headers
Christophe Varoqui [Tue, 15 Nov 2005 09:16:52 +0000 (10:16 +0100)]
[legal] seed the copyright headers

I tried to get it right from the first shot.
But experience showed it never works that way.
So please send corrections for inaccuracies and forgotten credits.

Regards,
cvaroqui

18 years ago[libmultipath] new hardware defaults
Christophe Varoqui [Sat, 12 Nov 2005 07:52:19 +0000 (08:52 +0100)]
[libmultipath] new hardware defaults

Pillardata hardware info submitted by Brian Wong.

18 years ago[multipathd] fix offline devices reported as active
Christophe Varoqui [Sat, 12 Nov 2005 00:09:18 +0000 (01:09 +0100)]
[multipathd] fix offline devices reported as active

multipathd(8) continues calling reinstate_path() in checkerloop(),
if multipathd(8) is started on the system which has multipath maps
including offline devices.
The reason is pp->checkfn() returns -1 for offline devices and
pp->state of these paths are 1.
(I'm using "echo offline > /sys/block/sd?/device/state" for the testing.)

As a result, multipathd(8) makes offline devices active state.
And this behavior also affects the no_path_retry feature, since
struct multipath.nr_active is incremented in reinstate_path().

The following patch fixes this problem.
If the return value from pp->checkfn is -1, the path isn't available.
So I think that we can ignore it.

Kiyoshi Ueda, NEC

18 years ago[build] fix the "rpm" make target
Christophe Varoqui [Fri, 11 Nov 2005 23:14:30 +0000 (00:14 +0100)]
[build] fix the "rpm" make target

John Steinman reported "make rpm" was broken.
This is due to files disappearing and others spawning.
This patch bringd the spec file in sync with reality.

18 years ago[multipath] set version and date strings 0.4.6
Christophe Varoqui [Fri, 11 Nov 2005 15:46:20 +0000 (16:46 +0100)]
[multipath] set version and date strings

Getting ready to release.

18 years ago[multipathd] remove daemonize() unused variable
Christophe Varoqui [Fri, 11 Nov 2005 12:50:18 +0000 (13:50 +0100)]
[multipathd] remove daemonize() unused variable

18 years ago[multipathd] don't care interpreting "\n" as a cli command
Christophe Varoqui [Fri, 11 Nov 2005 12:48:42 +0000 (13:48 +0100)]
[multipathd] don't care interpreting "\n" as a cli command

CR epileptics like me are happier now.

multipathd>
multipathd>
multipathd>
multipathd>
multipathd>
multipathd>
multipathd>

18 years ago[multipathd] small fixes
Christophe Varoqui [Fri, 11 Nov 2005 09:39:05 +0000 (10:39 +0100)]
[multipathd] small fixes

There was a spot where multipathd's reply length forgot to count the NULL,
and I noticed that the way domap go rewritten, the dry-run option doesn't
print out the maps.

This patch fixes both.

Benjamin Marzinski, Redhat

18 years ago[multipathd] improved daemon setup
Christophe Varoqui [Wed, 9 Nov 2005 22:45:30 +0000 (23:45 +0100)]
[multipathd] improved daemon setup

If you log into a machine and start the multipathd daemon, you will hang on
logout, because multipathd doesn't fully detach itself from the calling
processes. Also, occasionally the device mapper library functions will
print
error messages to stdout.  These appear in the terminal that was used to
start multipathd, if it was started by hand (not by init scripts).  To fix
these
I added some code to fully daemonize multipathd, and redirect stdout and
stderr to /dev/console.

Benjamin Marzinski, Redhat

18 years ago[multipathd] stop switch to best PG when no PG is active
Christophe Varoqui [Fri, 4 Nov 2005 09:37:03 +0000 (10:37 +0100)]
[multipathd] stop switch to best PG when no PG is active

To do that I added struct multipath:bestpg to store
switchgroup:select_path_group() result.

struct multipath:nextpg now only store current DM setting.

So the test is now (bestpg != nextpg) to trigger a switchgroup.

18 years ago[libmultipath] move the async logger in libmultipath, part2
Christophe Varoqui [Fri, 4 Nov 2005 09:06:06 +0000 (10:06 +0100)]
[libmultipath] move the async logger in libmultipath, part2

Remove old files

18 years ago[libmultipath] move the async logger in libmultipath
Christophe Varoqui [Fri, 4 Nov 2005 08:17:33 +0000 (09:17 +0100)]
[libmultipath] move the async logger in libmultipath

Brian Wong, Pillardata, suggested and implemented this to avoid
cross dependencies.

18 years ago[multipathd] fix failback
Christophe Varoqui [Thu, 3 Nov 2005 21:41:46 +0000 (22:41 +0100)]
[multipathd] fix failback

Refresh mpp->hwe before select_failback() in setup_multipath().
Proposed by Lan Tran, IBM, and Edward Goggin, EMC.