[dm-devel] [PATCH] multipath-tools: add RDAC SUN/ArrayStorage to hwtable

2018-04-15 Thread Xose Vazquez Perez
Already in scsi_dh: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/scsi/scsi_dh.c#n70 Cc: NetApp RDAC team Cc: Christophe Varoqui Cc: DM ML Signed-off-by: Xose Vazquez Perez --- libmultipath/hwtable.c | 12 1 file changed, 12 insertions(+) diff

Re: [dm-devel] [PATCH v4 12/20] multipath -u: change output to environment/key format

2018-04-15 Thread Benjamin Marzinski
On Wed, Apr 04, 2018 at 06:16:19PM +0200, Martin Wilck wrote: > ... instead of free format. This provides more flexibility > for udev rule processing for the future. Adapt code in multipath.rules. > The exit status remains as usual. This affects "multipath -c", too. > > The parameters "pathvec" an

Re: [dm-devel] [PATCH v3 17/20] multipath -u: test if path is busy

2018-04-15 Thread Benjamin Marzinski
On Mon, Apr 02, 2018 at 09:50:48PM +0200, Martin Wilck wrote: > For "find_multipaths smart", check if a path is already in use > before setting DM_MULTIPATH_DEVICE_PATH to 1 or 2 (and thus, > SYSTEMD_READY=0). If we don't do this, a device which has already been > mounted (e.g. during initrd proces

Re: [dm-devel] [PATCH v4 20/20] multipath.rules: find_multipaths "smart" logic

2018-04-15 Thread Benjamin Marzinski
On Wed, Apr 04, 2018 at 06:16:27PM +0200, Martin Wilck wrote: > When the first path to a device appears, we don't know if more paths are going > to follow. find_multipath "smart" logic attempts to solve this dilemma by > waiting for additional paths for a configurable time before giving up > and re

Re: [dm-devel] [PATCH 1/2] libmultipath: hwhandler auto-detection for ALUA

2018-04-15 Thread Benjamin Marzinski
On Thu, Apr 12, 2018 at 05:43:39PM +0200, Martin Wilck wrote: > Hi Ben, > > I'm unsure what to do. Do you still reject my patch? Or have you been > convinced by Hannes and my arguments? > Or are you requesting changes? If yes, what? I still feel that it's better to make the default config const

Re: [dm-devel] [PATCH v4 19/20] libmultipath: enable find_multipaths "smart"

2018-04-15 Thread Benjamin Marzinski
On Wed, Apr 04, 2018 at 06:16:26PM +0200, Martin Wilck wrote: > This activates "smart" path detection. This is similar to > "find_multipaths yes", but doesn't generally ignore single paths > that are not listed in the WWIDs file. Rather, such paths are > temporarily treated like multipath members.

Re: [dm-devel] [PATCH v4 09/20] libmultipath: functions to indicate mapping failure in /dev/shm

2018-04-15 Thread Benjamin Marzinski
On Thu, Apr 12, 2018 at 10:07:13PM +0200, Martin Wilck wrote: > On Thu, 2018-04-12 at 13:33 -0500, Benjamin Marzinski wrote: > > On Wed, Apr 04, 2018 at 06:16:16PM +0200, Martin Wilck wrote: > > > Create a simple API that indicates failure to create a map for a > > > certain WWID. This will allow m

Re: [dm-devel] [PATCH v2 2/2] multipath-tools: link LICENSES/LGPL-2.0 to LICENSE.default

2018-04-15 Thread Martin Wilck
On Thu, 2018-04-12 at 16:57 +0200, Xose Vazquez Perez wrote: > To indicate that the default licence is LGPL-2.0, > since there are still a lot of files without a licence header. > > Result: > multipath-tools/ > └── LICENSE.default -> LICENSES/LGPL-2.0 License.default is better than COPYING, which

Re: [dm-devel] [PATCH v4 19/20] libmultipath: enable find_multipaths "smart"

2018-04-15 Thread Martin Wilck
On Thu, 2018-04-12 at 13:47 -0500, Benjamin Marzinski wrote: > On Wed, Apr 04, 2018 at 06:16:26PM +0200, Martin Wilck wrote: > > This activates "smart" path detection. This is similar to > > "find_multipaths yes", but doesn't generally ignore single paths > > that are not listed in the WWIDs file.

[dm-devel] [PATCH ALT] multipath-tools: add licence info to README

2018-04-15 Thread Xose Vazquez Perez
Alternative patch to [PATCH v2 2/2] multipath-tools: link LICENSES/LGPL-2.0 to LICENSE.default Cc: Hannes Reinecke Cc: Benjamin Marzinski Cc: Martin Wilck Cc: Bart Van Assche Cc: Gris Ge Cc: Christophe Varoqui Cc: DM ML Signed-off-by: Xose Vazquez Perez --- README | 7 +++ 1 file cha

Re: [dm-devel] [PATCH ALT] multipath-tools: add licence info to README

2018-04-15 Thread Xose Vazquez Perez
On 04/13/2018 06:18 PM, Bart Van Assche wrote: > On Fri, 2018-04-13 at 18:17 +0200, Xose Vazquez Perez wrote: >> +Licence > > Isn't the preferred spelling "License"? https://en.oxforddictionaries.com/definition/licence licence (US license) Usage: Note that in British English licence is the cor

[dm-devel] [PATCH v5 18/22] multipath -u: quick check if path is multipathed

2018-04-15 Thread Martin Wilck
With "find_multipaths smart", we accept paths as valid if they are already part of a multipath map. This patch avoids doing a full path and device-mapper map scan for this case, speeding up "multipath -u" considerably. Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzinski --- libmultipath

[dm-devel] [PATCH v5 17/22] multipath -u: cleanup logic

2018-04-15 Thread Martin Wilck
The CMD_VALID_PATH logic is complex and hard to read and understand. This patch cleans it up a bit (preparing for folluw-up patches). It doesn't change any logic. Signed-off-by: Martin Wilck --- multipath/main.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mul

[dm-devel] [PATCH v5 08/22] libmultipath: use const char* in open_file()

2018-04-15 Thread Martin Wilck
Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck --- libmultipath/file.c | 6 +++--- libmultipath/file.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libmultipath/file.c b/libmultipath/file.c index e4951c92..d5165ec6 100644 --- a/libmultipath/file.c +++ b/lib

[dm-devel] [PATCH v5 19/22] multipath -u: don't grab devices already passed to system

2018-04-15 Thread Martin Wilck
Setting SYSTEMD_READY=0 on a device that has previously been passed to systemd is dangerous - already mounted file systems might be unmounted by systemd. Avoid that by checking for previously set DM_MULTIPATH_DEVICE_PATH environment variable. This requires to change the exit status of multipath -

[dm-devel] [PATCH v5 07/22] libmultipath: change find_multipaths option to multi-value

2018-04-15 Thread Martin Wilck
Change the "find_multipaths" option from yes/no to multi-value. This option now covers the effects of "find_multipaths" as it used to be, plus the -i option to multipath (ignore_wwids) and the -n option to multipathd (ignore_new_devs), excluding such combinations of the former options that are dang

[dm-devel] [PATCH v5 06/22] libmultipath: trigger path uevent only when necessary

2018-04-15 Thread Martin Wilck
Paths that are already classified as DM_MULTIPATH_DEVICE_PATH don't need to be retriggered. Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck --- libmultipath/configure.c | 12 1 file changed, 12 insertions(+) diff --git a/libmultipath/configure.c b/libmultipath/configur

[dm-devel] [PATCH v5 13/22] multipath -u: treat failed wwids as invalid

2018-04-15 Thread Martin Wilck
If a WWID has been marked as "failed", don't treat it as "valid multipath device path" in multipath -c/-u. This is key to achieve consistency between multipathd and udev rule processing. Signed-off-by: Martin Wilck Reviewed-by: Benjamin Marzinski --- multipath/main.c | 8 ++-- 1 file change

[dm-devel] [PATCH v5 03/22] libmultipath: should_multipath: keep existing maps

2018-04-15 Thread Martin Wilck
with find_multipaths "yes" and without the "-n" option to multipathd, if a path is already multipathed, keep it. The same logic is applied by "multipath -u -i". To do this, we need to add a "mpvec" parameter to should_multipath(). Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck ---

Re: [dm-devel] [PATCH v5 01/22] Revert "multipath: ignore -i if find_multipaths is set"

2018-04-15 Thread Hannes Reinecke
On Fri, 13 Apr 2018 23:59:54 +0200 Martin Wilck wrote: > This reverts commit ffbb886a8a16cb063d669cd76a1e656fd3ec8c4b. > > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > multipath/main.c | 10 -- > 1 file changed, 10 deletions(-) > Reviewed-by: Hannes Reinecke

Re: [dm-devel] [PATCH v5 02/22] Revert "multipathd: imply -n if find_multipaths is set"

2018-04-15 Thread Hannes Reinecke
On Fri, 13 Apr 2018 23:59:55 +0200 Martin Wilck wrote: > This reverts commit 64e27ec066a001012f44550f095c93443e91d845. > > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > multipathd/main.c | 4 > 1 file changed, 4 deletions(-) > Reviewed-by: Hannes Reinecke Chee

Re: [dm-devel] [PATCH v5 03/22] libmultipath: should_multipath: keep existing maps

2018-04-15 Thread Hannes Reinecke
On Fri, 13 Apr 2018 23:59:56 +0200 Martin Wilck wrote: > with find_multipaths "yes" and without the "-n" option to multipathd, > if a path is already multipathed, keep it. The same logic is applied > by "multipath -u -i". > > To do this, we need to add a "mpvec" parameter to should_multipath().

Re: [dm-devel] [PATCH v5 04/22] multipath -u -i: respect entries in WWIDs file

2018-04-15 Thread Hannes Reinecke
On Fri, 13 Apr 2018 23:59:57 +0200 Martin Wilck wrote: > Previously, if find_multipaths was set, devices listed in the WWIDs > file weren't classified as multipath members by "multipath -u -i" > unless they also met the "find_multipaths" criteria (at least two > paths, or existing map with this W

Re: [dm-devel] [PATCH v5 05/22] libmultipath: trigger change uevent on new device creation

2018-04-15 Thread Hannes Reinecke
On Fri, 13 Apr 2018 23:59:58 +0200 Martin Wilck wrote: > From: Benjamin Marzinski > > When multipath first sees a path device with find_multipaths > enabled, it can't know if the device should be multipathed. This means > that it will not claim the device in udev. If the device is > eventually

Re: [dm-devel] [PATCH v5 06/22] libmultipath: trigger path uevent only when necessary

2018-04-15 Thread Hannes Reinecke
On Fri, 13 Apr 2018 23:59:59 +0200 Martin Wilck wrote: > Paths that are already classified as DM_MULTIPATH_DEVICE_PATH don't > need to be retriggered. > > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libmultipath/configure.c | 12 > 1 file changed, 12 ins

Re: [dm-devel] [PATCH v5 07/22] libmultipath: change find_multipaths option to multi-value

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:00 +0200 Martin Wilck wrote: > Change the "find_multipaths" option from yes/no to multi-value. This > option now covers the effects of "find_multipaths" as it used to be, > plus the -i option to multipath (ignore_wwids) and the -n option to > multipathd (ignore_new_devs)

Re: [dm-devel] [PATCH v5 08/22] libmultipath: use const char* in open_file()

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:01 +0200 Martin Wilck wrote: > Reviewed-by: Benjamin Marzinski > Signed-off-by: Martin Wilck > --- > libmultipath/file.c | 6 +++--- > libmultipath/file.h | 2 +- > 2 files changed, 4 insertions(+), 4 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes --

Re: [dm-devel] [PATCH v5 09/22] libmultipath: functions to indicate mapping failure in /dev/shm

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:02 +0200 Martin Wilck wrote: > Create a simple API that indicates failure to create a map for a > certain WWID. This will allow multipathd to indicate to other tools > (in particular, "multipath -u" during udev processing) that > an attempt to create a map for a certain

Re: [dm-devel] [PATCH v5 10/22] libmultipath: indicate wwid failure in dm_addmap_create()

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:03 +0200 Martin Wilck wrote: > dm_addmap_create() is where we actually try to set up a new > multipath map. Depending on the result, mark the wwid as > failed (or not), and re-trigger an uevent if necessary. > If a path changes from multipath to non-multipath, use an "ad

Re: [dm-devel] [PATCH v5 11/22] multipath -u: common code path for result message

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:04 +0200 Martin Wilck wrote: > Print the result message in one place only. This simplifies > future changes. multipath -c is also affected. > > Signed-off-by: Martin Wilck > Reviewed-by: Benjamin Marzinski > --- > multipath/main.c | 32 +++

Re: [dm-devel] [PATCH v5 12/22] multipath -u: change output to environment/key format

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:05 +0200 Martin Wilck wrote: > ... instead of free format. This provides more flexibility > for udev rule processing for the future. Adapt code in > multipath.rules. The exit status remains as usual. This affects > "multipath -c", too. > > The parameters "pathvec" and "

Re: [dm-devel] [PATCH v5 13/22] multipath -u: treat failed wwids as invalid

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:06 +0200 Martin Wilck wrote: > If a WWID has been marked as "failed", don't treat it as "valid > multipath device path" in multipath -c/-u. This is key to achieve > consistency between multipathd and udev rule processing. > > Signed-off-by: Martin Wilck > Reviewed-by:

Re: [dm-devel] [PATCH v5 14/22] multipath -u: add DM_MULTIPATH_DEVICE_PATH=2 for "maybe"

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:07 +0200 Martin Wilck wrote: > Use DM_MULTIPATH_DEVICE_PATH="2" to indicate that this might be a > valid path, but we aren't certain. This happens with find_multipaths > "smart", when the first path to a device (or a single-path > device) is encountered, and the device i

Re: [dm-devel] [PATCH v5 15/22] libmultipath: implement find_multipaths_timeout

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:08 +0200 Martin Wilck wrote: > This makes the timeout for "find_multipaths smart" configurable. > If the timeout has a negative value (default), it's applied only > to "known" hardware which is either in the hwtable or in a "device" > section in multipath.conf. For typic

Re: [dm-devel] [PATCH v5 16/22] multipath -u : set FIND_MULTIPATHS_WAIT_UNTIL from /dev/shm

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:09 +0200 Martin Wilck wrote: > In "find_multipaths smart" mode, use time stamps under > /dev/shm/multipath/find_multipaths to track waiting for multipath > siblings. When a path is first encountered and is "maybe" multipath, > create a file under /dev/shm, set its modifi

Re: [dm-devel] [PATCH v5 17/22] multipath -u: cleanup logic

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:10 +0200 Martin Wilck wrote: > The CMD_VALID_PATH logic is complex and hard to read and understand. > This patch cleans it up a bit (preparing for folluw-up patches). > It doesn't change any logic. > > Signed-off-by: Martin Wilck > --- > multipath/main.c | 12 +++-

Re: [dm-devel] [PATCH v5 18/22] multipath -u: quick check if path is multipathed

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:11 +0200 Martin Wilck wrote: > With "find_multipaths smart", we accept paths as valid if they are > already part of a multipath map. This patch avoids doing a full path > and device-mapper map scan for this case, speeding up "multipath -u" > considerably. > > Signed-off

Re: [dm-devel] [PATCH v5 19/22] multipath -u: don't grab devices already passed to system

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:12 +0200 Martin Wilck wrote: > Setting SYSTEMD_READY=0 on a device that has previously been passed to > systemd is dangerous - already mounted file systems might be > unmounted by systemd. > > Avoid that by checking for previously set DM_MULTIPATH_DEVICE_PATH > environm

Re: [dm-devel] [PATCH v5 20/22] multipath -u: test if path is busy

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:13 +0200 Martin Wilck wrote: > For "find_multipaths smart", check if a path is already in use > before setting DM_MULTIPATH_DEVICE_PATH to 1 or 2 (and thus, > SYSTEMD_READY=0). If we don't do this, a device which has already been > mounted (e.g. during initrd processing)

Re: [dm-devel] [PATCH v5 21/22] libmultipath: enable find_multipaths "smart"

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:14 +0200 Martin Wilck wrote: > This activates "smart" path detection. This is similar to > "find_multipaths yes", but doesn't generally ignore single paths > that are not listed in the WWIDs file. Rather, such paths are > temporarily treated like multipath members. If no

Re: [dm-devel] [PATCH v5 22/22] multipath.rules: find_multipaths "smart" logic

2018-04-15 Thread Hannes Reinecke
On Sat, 14 Apr 2018 00:00:15 +0200 Martin Wilck wrote: > When the first path to a device appears, we don't know if more paths > are going to follow. find_multipath "smart" logic attempts to solve > this dilemma by waiting for additional paths for a configurable time > before giving up and releasi