platform/upstream/multipath-tools.git
18 years ago[multipath] remove dead maps
Christophe Varoqui [Mon, 3 Oct 2005 15:46:24 +0000 (17:46 +0200)]
[multipath] remove dead maps

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

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

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

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

This map purge is clearly an interactive maintenance operation.

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

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

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

Thanks again, Patrick.

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

Reported by Maxim Kozover

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

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

Stefan Bader, IBM

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

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

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

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

When open() failed for another reason than EBUSY.

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

Stefan Bader, IBM

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

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

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

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

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

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

IOW outs something like :

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

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

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

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

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

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

Patrick Caulfield, Redhat.

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

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

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

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

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

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

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

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

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

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

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

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

This bug hit bad with partitions for example.

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

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

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

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

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

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

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

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

previously set to 755.

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

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

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

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

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

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

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

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

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

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

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

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

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

Rationale from Edward Goggin, EMC :

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

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

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

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

Edward Goggin, EMC

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

This will make for denser config files.

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

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

Edward Goggin, EMC

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

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

From Alasdair Kergon, Redhat.

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

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

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

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

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

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

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

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

From Stefan Bader, IBM

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

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

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

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

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

... and purge uneeded configlets :

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

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

Disabled by default.

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

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

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

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

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

The rest is the config switch handling, and printing.

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

dlog() contains #if DAEMON statements.

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

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

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

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

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

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

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

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

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

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

They are already dealt with in the format string

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

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

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

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

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

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

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

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

and update all callers (nice cleanup).

The printing buffer overflow checking is done right at last.

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

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

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

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

Renamed *_RESERVED to *_UNDEF all over includes.

Update all users.

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

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

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

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

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

and remove now useless $INSTALLDIRS and $ALLDIRS

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

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

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

done with O_EXCL

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

Well, this is useful for testing with usb keys

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.

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

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