[dm-devel] [PATCH] libmultipath: retry to get path serial number by get_serial() after failure by get_vpd_sysfs()

2016-08-11 Thread tang . junhui
From: "tang.junhui" 

Some operating systems have no such file vpd_pg80 in sys directory
such as /sys/devices/platform/host23/session21/target23:0:0/23:0:0:33/,
so path serial number would be failed to get by get_vpd_sysfs(),
we need retry to get it by get_serial to avoid empty serial of the path.

Signed-off-by: tang.junhui 
---
 libmultipath/discovery.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 0974c92..bb3116d 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1435,10 +1435,14 @@ scsi_ioctl_pathinfo (struct path * pp, int mask)
if (!attr_path || pp->sg_id.host_no == -1)
return 0;
 
-   if (get_vpd_sysfs(parent, 0x80, pp->serial, SERIAL_SIZE) > 0)
-   condlog(3, "%s: serial = %s",
-   pp->dev, pp->serial);
+   if (get_vpd_sysfs(parent, 0x80, pp->serial, SERIAL_SIZE) <= 0) {
+   if (get_serial(pp->serial, SERIAL_SIZE, pp->fd)) {
+   condlog(2, "%s: fail to get serial", pp->dev);
+   return 0;
+   }
+   }
 
+   condlog(3, "%s: serial = %s", pp->dev, pp->serial);
return 0;
 }
 
-- 
2.8.1.windows.1

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


Re: [dm-devel] [PATCH 2/4] multipath-tools: add checker callout to repair path

2016-08-11 Thread Bart Van Assche

On 08/11/2016 01:33 PM, Mike Christie wrote:

Could you try the attached patch. I found two segfaults. If check_path
returns less than 0 then we free the path and so we cannot call repair
on it. If libcheck_init fails it memsets the checker, so we cannot call
repair on it too.

I moved the repair call to the specific paths that the path is down.


Hello Mike,

Thanks for the patch. Unfortunately even with this patch applied I can 
still trigger a segfault sporadically:


# valgrind --read-var-info=yes multipathd -d
Aug 11 14:02:21 | mpathbf: load table [0 2097152 multipath 3 
queue_if_no_path pg_init_retries 50 0 2 1 queue-length 0 1 1 8:160 1000 
queue-length 0 1 1 8:64 1000]

Aug 11 14:02:21 | mpathbf: event checker started
Aug 11 14:02:21 | sdk [8:160]: path added to devmap mpathbf
Aug 11 14:02:21 | sdd: add path (uevent)
==2452== Thread 4:
==2452== Jump to the invalid address stated on the next line
==2452==at 0x0: ???
==2452==by 0x409BBE: repair_path (main.c:1451)
==2452==by 0x40A905: check_path (main.c:1715)
==2452==by 0x40AE72: checkerloop (main.c:1808)
==2452==by 0x5047473: start_thread (pthread_create.c:333)
==2452==by 0x671B3EC: clone (clone.S:109)
==2452==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==2452==
==2452==
==2452== Process terminating with default action of signal 11 (SIGSEGV)
==2452==  Bad permissions for mapped region at address 0x0
==2452==at 0x0: ???
==2452==by 0x409BBE: repair_path (main.c:1451)
==2452==by 0x40A905: check_path (main.c:1715)
==2452==by 0x40AE72: checkerloop (main.c:1808)
==2452==by 0x5047473: start_thread (pthread_create.c:333)
==2452==by 0x671B3EC: clone (clone.S:109)
==2452==

(gdb) list main.c:1451
1446void repair_path(struct path * pp)
1447{
1448if (pp->state != PATH_DOWN)
1449return;
1450
1451checker_repair(&pp->checker);
1452if (strlen(checker_message(&pp->checker)))
1453LOG_MSG(1, checker_message(&pp->checker));
1454}
1455

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


Re: [dm-devel] [PATCH 2/4] multipath-tools: add checker callout to repair path

2016-08-11 Thread Mike Christie
On 08/11/2016 10:50 AM, Bart Van Assche wrote:
> On 08/08/2016 05:01 AM, Mike Christie wrote:
>> This patch adds a callback which can be used to repair a path
>> if check() has determined it is in the PATH_DOWN state.
>>
>> The next patch that adds rbd checker support which will use this to
>> handle the case where a rbd device is blacklisted.
> 
> Hello Mike,
> 
> With this patch applied, with the TUR checker enabled in multipath.conf
> I see the following crash if I trigger SRP failover and failback:
> 
> ion-dev-ib-ini:~ # gdb ~bart/software/multipath-tools/multipathd/multipathd
> (gdb) handle SIGPIPE noprint nostop
> SignalStop  Print   Pass to program Description
> SIGPIPE   NoNo  Yes Broken pipe
> (gdb) run -d
> Aug 11 08:46:27 | sde: remove path (uevent)
> Aug 11 08:46:27 | mpathbe: adding map
> Aug 11 08:46:27 | 8:64: cannot find block device
> Aug 11 08:46:27 | Invalid device number 1
> Aug 11 08:46:27 | 1: cannot find block device
> Aug 11 08:46:27 | 8:96: cannot find block device
> Aug 11 08:46:27 | mpathbe: failed to setup multipath
> Aug 11 08:46:27 | dm-0: uev_add_map failed
> Aug 11 08:46:27 | uevent trigger error
> 
> Thread 4 "multipathd" received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x77f8b700 (LWP 8446)]
> 0x in ?? ()
> (gdb) bt
> #0  0x in ?? ()
> #1  0x76c41905 in checker_repair (c=0x7fffdc001ef0) at checkers.c:225
> #2  0x0040a760 in repair_path (vecs=0x66d7e0, pp=0x7fffdc001a40)
> at main.c:1733
> #3  0x0040ab27 in checkerloop (ap=0x66d7e0) at main.c:1807
> #4  0x779bb474 in start_thread (arg=0x77f8b700)
> at pthread_create.c:333
> #5  0x763243ed in clone ()
> at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
> (gdb) up
> #1  0x76c41905 in checker_repair (c=0x7fffdc001ef0) at checkers.c:225
> 225 c->repair(c);
> (gdb) print *c
> $1 = {node = {next = 0x0, prev = 0x0}, handle = 0x0, refcount = 0, fd = 0, 
>   sync = 0, timeout = 0, disable = 0, name = '\000' , 
>   message = '\000' , context = 0x0, mpcontext = 0x0, 
>   check = 0x0, repair = 0x0, init = 0x0, free = 0x0}
> 

Sorry about the stupid bug.

Could you try the attached patch. I found two segfaults. If check_path
returns less than 0 then we free the path and so we cannot call repair
on it. If libcheck_init fails it memsets the checker, so we cannot call
repair on it too.

I moved the repair call to the specific paths that the path is down.
diff --git a/multipathd/main.c b/multipathd/main.c
index f34500c..9f213cc 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1442,6 +1442,16 @@ int update_path_groups(struct multipath *mpp, struct vectors *vecs, int refresh)
 	return 0;
 }
 
+void repair_path(struct path * pp)
+{
+	if (pp->state != PATH_DOWN)
+		return;
+
+	checker_repair(&pp->checker);
+	if (strlen(checker_message(&pp->checker)))
+		LOG_MSG(1, checker_message(&pp->checker));
+}
+
 /*
  * Returns '1' if the path has been checked, '-1' if it was blacklisted
  * and '0' otherwise
@@ -1606,6 +1616,7 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
 			pp->mpp->failback_tick = 0;
 
 			pp->mpp->stat_path_failures++;
+			repair_path(pp);
 			return 1;
 		}
 
@@ -1700,7 +1711,7 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
 	}
 
 	pp->state = newstate;
-
+	repair_path(pp);
 
 	if (pp->mpp->wait_for_udev)
 		return 1;
@@ -1725,14 +1736,6 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
 	return 1;
 }
 
-void repair_path(struct vectors * vecs, struct path * pp)
-{
-	if (pp->state != PATH_DOWN)
-		return;
-
-	checker_repair(&pp->checker);
-}
-
 static void *
 checkerloop (void *ap)
 {
@@ -1804,7 +1807,6 @@ checkerloop (void *ap)
 	i--;
 } else
 	num_paths += rc;
-repair_path(vecs, pp);
 			}
 			lock_cleanup_pop(vecs->lock);
 		}
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH] dm-mpath: always return reservation conflict

2016-08-11 Thread Christoph Hellwig
ping?

On Tue, Aug 02, 2016 at 02:36:32PM +0200, Christoph Hellwig wrote:
> From: Hannes Reinecke 
> 
> If dm-mpath encounters an reservation conflict it should not fail the
> path (as communication with the target is not affected) but should
> rather retry on another path. However, in doing so we might be inducing
> a ping-pong between paths, with no guarantee of any forward progress.
> 
> And arguably a reservation conflict is an unexpected error, so we should
> be passing it upwards to allow the application to take appropriate steps.
> 
> Signed-off-by: Hannes Reinecke 
> Acked-by: Christoph Hellwig 
> Tested-by: Christoph Hellwig 
> ---
>  drivers/md/dm-mpath.c | 14 ++
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
> index 7eac080..8d2f916 100644
> --- a/drivers/md/dm-mpath.c
> +++ b/drivers/md/dm-mpath.c
> @@ -1555,16 +1555,22 @@ static int do_end_io(struct multipath *m, struct 
> request *clone,
>   if (noretry_error(error))
>   return error;
>  
> - if (mpio->pgpath)
> + /*
> +  * EBADE signals an reservation conflict.
> +  * We shouldn't fail the path here as we can communicate with
> +  * the target. We should failover to the next path, but in
> +  * doing so we might be causing a ping-pong between paths.
> +  * So just return the reservation conflict error.
> +  */
> + if (error == -EBADE)
> + r = error;
> + else if (mpio->pgpath)
>   fail_path(mpio->pgpath);
>  
>   if (!atomic_read(&m->nr_valid_paths)) {
>   if (!test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) {
>   if (!must_push_back_rq(m))
>   r = -EIO;
> - } else {
> - if (error == -EBADE)
> - r = error;
>   }
>   }
>  
> -- 
> 2.1.4
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
---end quoted text---

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[dm-devel] [PATCH 08/11] multipath-tools: add KOVE/XPD to hwtable

2016-08-11 Thread Xose Vazquez Perez
Info provided directly by the manufacturer: http://kove.net/xpd

Cc: Nick Russo 
Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 libmultipath/hwtable.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index 063535c..8114d3e 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -839,6 +839,15 @@ static struct hwentry default_hw[] = {
.checker_name  = RBD,
.deferred_remove = DEFERRED_REMOVE_ON,
},
+   /*
+* Kove
+*/
+   {
+   .vendor= "KOVE",
+   .product   = "XPD",
+   .pgpolicy  = MULTIBUS,
+   .pgfailback= FAILBACK_UNDEF,
+   },
 #if 0
/*
 * Copy this TEMPLATE to add new hardware.
-- 
2.7.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[dm-devel] [PATCH 06/11] multipath-tools: request to update man pages if the code is changed

2016-08-11 Thread Xose Vazquez Perez
Please, document the changes.

Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 libmultipath/checkers/Makefile | 1 +
 libmultipath/defaults.h| 4 
 libmultipath/dict.c| 3 +++
 libmultipath/prioritizers/Makefile | 1 +
 4 files changed, 9 insertions(+)

diff --git a/libmultipath/checkers/Makefile b/libmultipath/checkers/Makefile
index e46192c..11ab76f 100644
--- a/libmultipath/checkers/Makefile
+++ b/libmultipath/checkers/Makefile
@@ -5,6 +5,7 @@ include ../../Makefile.inc
 
 CFLAGS += -I..
 
+# If you add or remove a checker also update multipath/multipath.conf.5
 LIBS= \
libcheckcciss_tur.so \
libcheckreadsector0.so \
diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
index dd6a24b..3af85eb 100644
--- a/libmultipath/defaults.h
+++ b/libmultipath/defaults.h
@@ -1,3 +1,7 @@
+/*
+ * If you add or modify a value also update multipath/multipath.conf.5
+ * and the TEMPLATE in libmultipath/hwtable.c
+ */
 #define DEFAULT_UID_ATTRIBUTE  "ID_SERIAL"
 #define DEFAULT_UDEVDIR"/dev"
 #define DEFAULT_MULTIPATHDIR   "/" LIB_STRING "/multipath"
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index 1933b6d..e8c6804 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -1329,6 +1329,9 @@ snprint_deprecated (struct config *conf, char * buff, int 
len, void * data)
 
 #define __deprecated
 
+/*
+ * If you add or remove a keywork also update multipath/multipath.conf.5
+ */
 void
 init_keywords(vector keywords)
 {
diff --git a/libmultipath/prioritizers/Makefile 
b/libmultipath/prioritizers/Makefile
index eff5fc1..36b42e4 100644
--- a/libmultipath/prioritizers/Makefile
+++ b/libmultipath/prioritizers/Makefile
@@ -5,6 +5,7 @@ include ../../Makefile.inc
 
 CFLAGS += -I..
 
+# If you add or remove a prioritizer also update multipath/multipath.conf.5
 LIBS = \
libprioalua.so \
libprioconst.so \
-- 
2.7.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[dm-devel] [PATCH 04/11] multipath-tools: Edward Goggin no longer works at EMC

2016-08-11 Thread Xose Vazquez Perez
Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 libmultipath/hwtable.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index cd052e4..7d1f85e 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -161,9 +161,6 @@ static struct hwentry default_hw[] = {
},
/*
 * EMC
-*
-* Maintainer : Edward Goggin
-* Mail : egog...@emc.com
 */
{
/* Symmetrix / DMX / VMAX */
-- 
2.7.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[dm-devel] [PATCH 11/11] multipath-tools: modify product regex in HDS devices

2016-08-11 Thread Xose Vazquez Perez
regex for product="DF" is to wide.
Also changed for VSP to "^OPEN-"

I asked Matthias before make this change.

Cc: Matthias Rudolph 
Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 libmultipath/hwtable.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index 62633b1..a69002f 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -278,14 +278,14 @@ static struct hwentry default_hw[] = {
{
/* USP-V, HUS VM, VSP, VSP G1000 and VSP GX00 families */
.vendor= "(HITACHI|HP)",
-   .product   = "OPEN-",
+   .product   = "^OPEN-",
.pgpolicy  = MULTIBUS,
.pgfailback= FAILBACK_UNDEF,
},
{
/* AMS 2000 and HUS 100 families */
.vendor= "HITACHI",
-   .product   = "DF",
+   .product   = "^DF",
.features  = "1 queue_if_no_path",
.pgpolicy  = GROUP_BY_PRIO,
.pgfailback= -FAILBACK_IMMEDIATE,
-- 
2.7.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[dm-devel] [PATCH 01/11] multipath-tools: add support for all IBM Enterprise Storage Server / Shark family

2016-08-11 Thread Xose Vazquez Perez
Only F20 and 800 were included:
2105F20 IBM Enterprise Storage Server Model F20
2105800 IBM TotalStorage Enterprise Storage Server Model 800

Added all of them with just "^2105"
2105E10 IBM Enterprise Storage Server Model E10
2105E20 IBM Enterprise Storage Server Model E20
2105F10 IBM Enterprise Storage Server Model F10
2105750 IBM TotalStorage Enterprise Storage Server Model 750

Cc: Hannes Reinecke 
Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 libmultipath/hwtable.c | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index edfd8fe..cd052e4 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -444,17 +444,9 @@ static struct hwentry default_hw[] = {
.pgfailback= FAILBACK_UNDEF,
},
{
-   /* Enterprise Storage Server / Shark 800 */
+   /* Enterprise Storage Server / Shark family */
.vendor= "IBM",
-   .product   = "^2105800",
-   .features  = "1 queue_if_no_path",
-   .pgpolicy  = GROUP_BY_SERIAL,
-   .pgfailback= FAILBACK_UNDEF,
-   },
-   {
-   /* Enterprise Storage Server / Shark F20 */
-   .vendor= "IBM",
-   .product   = "^2105F20",
+   .product   = "^2105",
.features  = "1 queue_if_no_path",
.pgpolicy  = GROUP_BY_SERIAL,
.pgfailback= FAILBACK_UNDEF,
-- 
2.7.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[dm-devel] [PATCH 05/11] multipath-tools: delete IBM/1745 ghost array

2016-08-11 Thread Xose Vazquez Perez
There is no references nowhere.
Confirmed by the original manufacturer(NetApp), and Google shows no results.

Cc: Sean Stewart 
Cc: Hannes Reinecke 
Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 libmultipath/hwtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index 7d1f85e..063535c 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -358,7 +358,7 @@ static struct hwentry default_hw[] = {
{
/* DS3500 / DS3512 / DS3524 */
.vendor= "IBM",
-   .product   = "^(1745|1746)",
+   .product   = "^1746",
.bl_product= "Universal Xport",
.pgpolicy  = GROUP_BY_PRIO,
.checker_name  = RDAC,
-- 
2.7.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[dm-devel] [PATCH 03/11] multipath-tools: Makefiles housekeeping

2016-08-11 Thread Xose Vazquez Perez
Apart of this relevant change in libmpathpersist/Makefile
-   $(CC) -Wall -fPIC -c $(CFLAGS) *.c
+   $(CC) -c $(CFLAGS) *.c

Mainly indent and order code.

Compiled tested, also installed and uninstalled.

Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 Makefile   | 32 -
 Makefile.inc   | 48 +++---
 kpartx/Makefile|  5 ++--
 libmpathcmd/Makefile   |  6 ++---
 libmpathpersist/Makefile   | 18 +-
 libmultipath/Makefile  | 29 +++
 libmultipath/checkers/Makefile |  5 ++--
 libmultipath/prioritizers/Makefile |  5 ++--
 mpathpersist/Makefile  | 13 +--
 multipath/Makefile |  8 +++
 multipathd/Makefile| 32 -
 11 files changed, 89 insertions(+), 112 deletions(-)

diff --git a/Makefile b/Makefile
index cf1acd9..7786c83 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,3 @@
-# Makefile
 #
 # Copyright (C) 2003 Christophe Varoqui, 
 #
@@ -6,16 +5,17 @@
 #
 # Try to supply the linux kernel headers.
 #
-ifeq($(KRNLSRC),)
-KRNLLIB = /lib/modules/$(shell uname -r)
-ifeq($(shell test -r $(KRNLLIB)/source && echo 1),1)
-KRNLSRC = $(KRNLLIB)/source
-KRNLOBJ = $(KRNLLIB)/build
-else
-KRNLSRC = $(KRNLLIB)/build
-KRNLOBJ = $(KRNLLIB)/build
-endif
+ifeq ($(KRNLSRC),)
+   KRNLLIB = /lib/modules/$(shell uname -r)
+   ifeq ($(shell test -r $(KRNLLIB)/source && echo 1),1)
+   KRNLSRC = $(KRNLLIB)/source
+   KRNLOBJ = $(KRNLLIB)/build
+   else
+   KRNLSRC = $(KRNLLIB)/build
+   KRNLOBJ = $(KRNLLIB)/build
+   endif
 endif
+
 export KRNLSRC
 export KRNLOBJ
 
@@ -30,10 +30,10 @@ BUILDDIRS = \
mpathpersist \
kpartx
 
-ifeq   ($(MULTIPATH_VERSION),)
-VERSION = $(shell basename ${PWD} | cut -d'-' -f3)
+ifeq ($(MULTIPATH_VERSION),)
+   VERSION = $(shell basename ${PWD} | cut -d'-' -f3)
 else
-VERSION = $(MULTIPATH_VERSION)
+   VERSION = $(MULTIPATH_VERSION)
 endif
 
 all: recurse
@@ -59,11 +59,11 @@ recurse_uninstall:
$(MAKE) -C $$dir uninstall || exit $?; \
done
 
-clean: recurse_clean
+clean: recurse_clean
 
-install:   recurse_install
+install: recurse_install
 
-uninstall: recurse_uninstall
+uninstall: recurse_uninstall
 
 .PHONY:TAGS
 TAGS:
diff --git a/Makefile.inc b/Makefile.inc
index 3e8635f..0808e64 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,6 +1,6 @@
-# Makefile.inc
 #
 # Copyright (C) 2004 Christophe Varoqui, 
+#
 
 #
 # Allow to force some libraries to be used statically. (Uncomment one of the
@@ -39,32 +39,32 @@ ifndef SYSTEMDPATH
SYSTEMDPATH=usr/lib
 endif
 
-prefix  =
-exec_prefix = $(prefix)
-bindir  = $(exec_prefix)/sbin
-libudevdir  = $(prefix)/$(SYSTEMDPATH)/udev
-udevrulesdir = $(libudevdir)/rules.d
-multipathdir = $(TOPDIR)/libmultipath
-mandir  = $(prefix)/usr/share/man/man8
-man5dir = $(prefix)/usr/share/man/man5
-man3dir  = $(prefix)/usr/share/man/man3
-syslibdir   = $(prefix)/$(LIB)
-incdir  = $(prefix)/usr/include
-libdir = $(prefix)/$(LIB)/multipath
-unitdir = $(prefix)/$(SYSTEMDPATH)/systemd/system
-mpathpersistdir = $(TOPDIR)/libmpathpersist
-mpathcmddir = $(TOPDIR)/libmpathcmd
+prefix =
+exec_prefix= $(prefix)
+bindir = $(exec_prefix)/sbin
+libudevdir = $(prefix)/$(SYSTEMDPATH)/udev
+udevrulesdir   = $(libudevdir)/rules.d
+multipathdir   = $(TOPDIR)/libmultipath
+mandir = $(prefix)/usr/share/man/man8
+man5dir= $(prefix)/usr/share/man/man5
+man3dir= $(prefix)/usr/share/man/man3
+syslibdir  = $(prefix)/$(LIB)
+incdir = $(prefix)/usr/include
+libdir = $(prefix)/$(LIB)/multipath
+unitdir= $(prefix)/$(SYSTEMDPATH)/systemd/system
+mpathpersistdir= $(TOPDIR)/libmpathpersist
+mpathcmddir= $(TOPDIR)/libmpathcmd
 
-GZIP= gzip -9 -c
-RM  = rm -f
-LN  = ln -sf
-INSTALL_PROGRAM = install
+GZIP   = gzip -9 -c
+RM = rm -f
+LN = ln -sf
+INSTALL_PROGRAM= install
 
-OPTFLAGS = -Wunused -Wstrict-prototypes -O2 -g -pipe -Wformat-security 
-Wall \
-   -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4
+OPTFLAGS   = -Wunused -Wstrict-prototypes -O2 -g -pipe -Wformat-security 
-Wall \
+ -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4
 
-CFLAGS  = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\"
-SHARED_FLAGS = -shared
+CFLAGS = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\"
+SHARED_FLAGS   = -shared
 
 %.o:   %.c
$(CC) $(CFLAGS) -c -o $@ $<
diff --git a/kpartx/Makefile b/kpartx/Makefile
index 70f836e..75b7606 100644
--- a/kpar

[dm-devel] [PATCH 10/11] multipath-tools: move code up in Makefile

2016-08-11 Thread Xose Vazquez Perez
Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 Makefile | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 7786c83..95c7dfb 100644
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,12 @@ ifeq ($(KRNLSRC),)
endif
 endif
 
+ifeq ($(MULTIPATH_VERSION),)
+   VERSION = $(shell basename ${PWD} | cut -d'-' -f3)
+else
+   VERSION = $(MULTIPATH_VERSION)
+endif
+
 export KRNLSRC
 export KRNLOBJ
 
@@ -30,12 +36,6 @@ BUILDDIRS = \
mpathpersist \
kpartx
 
-ifeq ($(MULTIPATH_VERSION),)
-   VERSION = $(shell basename ${PWD} | cut -d'-' -f3)
-else
-   VERSION = $(MULTIPATH_VERSION)
-endif
-
 all: recurse
 
 recurse:
-- 
2.7.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[dm-devel] [PATCH 02/11] multipath-tools: minor edit of multipath/multipath.conf.5

2016-08-11 Thread Xose Vazquez Perez
Split long lines, and change a text from place.

Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 multipath/multipath.conf.5 | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5
index 3b66ddb..fd4b1f2 100644
--- a/multipath/multipath.conf.5
+++ b/multipath/multipath.conf.5
@@ -147,10 +147,11 @@ Default value is: \fBno\fR
 .
 .TP
 .B multipath_dir
-Directory where the dynamic shared objects are stored. Defined at compile time.
+Directory where the dynamic shared objects are stored.
 .RS
 .TP
-Default value is: \fB\fR, commonly \fI/lib64/multipath/\fR
+Default value is: \fB\fR. Defined at compile time, commonly
+\fI/lib64/multipath/\fR.
 .RE
 .
 .
@@ -303,8 +304,9 @@ regex can be of SCSI H:B:T:L format. For example: 1:0:.:. , 
*:0:0:.
 regex can be of device name format. For example: sda , sd.e
 .TP
 .I serial
-regex can be of serial number format. For example: .*J1FR.*324 . The serial 
can be looked
-up through sysfs or by running multipathd show paths format "%z". For example: 
0395J1FR904324
+regex can be of serial number format. For example: .*J1FR.*324 . The serial can
+be looked up through sysfs or by running multipathd show paths format "%z". For
+example: 0395J1FR904324
 .TP
 .I wwn
 regex can be of the form \fI"host_wwnn:host_wwpn:target_wwnn:target_wwpn"\fR
@@ -336,8 +338,8 @@ Possible values for the feature list are:
 .RS
 .TP 12
 .I queue_if_no_path
-(Superseded by \fIno_path_retry\fR) Queue IO if no path is active. Identical 
to the \fIno_path_retry\fR with
-\fIqueue\fR value. See KNOWN ISSUES.
+(Superseded by \fIno_path_retry\fR) Queue IO if no path is active. Identical to
+the \fIno_path_retry\fR with \fIqueue\fR value. See KNOWN ISSUES.
 .TP
 .I no_partitions
 Disable automatic partitions generation via kpartx.
@@ -580,7 +582,8 @@ Default value is: \fB600\fR
 .
 .TP
 .B bindings_file
-The full pathname of the binding file to be used when the user_friendly_names 
option is set.
+The full pathname of the binding file to be used when the user_friendly_names
+option is set.
 .RS
 .TP
 Default value is: \fB/etc/multipath/bindings\fR
-- 
2.7.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[dm-devel] [PATCH 09/11] multipath-tools: delete failback from IBM/2810XIV

2016-08-11 Thread Xose Vazquez Perez
nonsense with multibus as path_grouping_policy

Cc: Hannes Reinecke 
Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 libmultipath/hwtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index 8114d3e..62633b1 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -517,7 +517,7 @@ static struct hwentry default_hw[] = {
.product   = "2810XIV",
.features  = "1 queue_if_no_path",
.pgpolicy  = MULTIBUS,
-   .pgfailback= 15,
+   .pgfailback= FAILBACK_UNDEF,
},
/*
 * IBM Power Virtual SCSI Devices
-- 
2.7.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[dm-devel] [PATCH 07/11] multipath-tools: move DEFAULT_PRIO DEFAULT_PRIO_ARGS and DEFAULT_CHECKER to libmultipath/defaults.h

2016-08-11 Thread Xose Vazquez Perez
Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 libmultipath/checkers.h | 3 +--
 libmultipath/defaults.h | 3 +++
 libmultipath/prio.h | 4 +---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libmultipath/checkers.h b/libmultipath/checkers.h
index 502d2d9..4fb97c9 100644
--- a/libmultipath/checkers.h
+++ b/libmultipath/checkers.h
@@ -3,6 +3,7 @@
 
 #include "list.h"
 #include "memory.h"
+#include "defaults.h"
 
 /*
  *
@@ -86,8 +87,6 @@ enum path_check_state {
 #define CCISS_TUR"cciss_tur"
 #define RBD  "rbd"
 
-#define DEFAULT_CHECKER TUR
-
 #define ASYNC_TIMEOUT_SEC  30
 
 /*
diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h
index 3af85eb..9bf27d6 100644
--- a/libmultipath/defaults.h
+++ b/libmultipath/defaults.h
@@ -28,6 +28,9 @@
 #define DEFAULT_RETRIGGER_DELAY10
 #define DEFAULT_RETRIGGER_TRIES3
 #define DEFAULT_UEV_WAIT_TIMEOUT 30
+#define DEFAULT_PRIO   "const"
+#define DEFAULT_PRIO_ARGS  ""
+#define DEFAULT_CHECKERTUR
 
 #define DEFAULT_CHECKINT   5
 #define MAX_CHECKINT(a)(a << 2)
diff --git a/libmultipath/prio.h b/libmultipath/prio.h
index 032028e..261105b 100644
--- a/libmultipath/prio.h
+++ b/libmultipath/prio.h
@@ -12,9 +12,7 @@ struct path;
 
 #include "list.h"
 #include "memory.h"
-
-#define DEFAULT_PRIO "const"
-#define DEFAULT_PRIO_ARGS ""
+#include "defaults.h"
 
 /*
  * Known prioritizers for use in hwtable.c
-- 
2.7.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


Re: [dm-devel] dm-mq and end_clone_request()

2016-08-11 Thread Laurence Oberman


- Original Message -
> From: "Laurence Oberman" 
> To: "Bart Van Assche" 
> Cc: dm-devel@redhat.com, linux-s...@vger.kernel.org, "Mike Snitzer" 
> , "Johannes Thumshirn"
> 
> Sent: Wednesday, August 10, 2016 5:38:16 PM
> Subject: Re: [dm-devel] dm-mq and end_clone_request()
> 
> 
> 
> - Original Message -
> > From: "Laurence Oberman" 
> > To: "Bart Van Assche" 
> > Cc: dm-devel@redhat.com, linux-s...@vger.kernel.org, "Mike Snitzer"
> > , "Johannes Thumshirn"
> > 
> > Sent: Tuesday, August 9, 2016 1:21:15 PM
> > Subject: Re: [dm-devel] dm-mq and end_clone_request()
> > 
> > 
> > 
> > - Original Message -
> > > From: "Bart Van Assche" 
> > > To: "Laurence Oberman" 
> > > Cc: dm-devel@redhat.com, linux-s...@vger.kernel.org, "Mike Snitzer"
> > > , "Johannes Thumshirn"
> > > 
> > > Sent: Tuesday, August 9, 2016 1:16:52 PM
> > > Subject: Re: [dm-devel] dm-mq and end_clone_request()
> > > 
> > > On 08/09/2016 10:12 AM, Laurence Oberman wrote:
> > > > I was talking about this patch
> > > >
> > > > --- a/drivers/scsi/scsi_scan.c
> > > > +++ b/drivers/scsi/scsi_scan.c
> > > > @@ -1890,10 +1890,11 @@ void scsi_forget_host(struct Scsi_Host *shost)
> > > >   restart:
> > > >  spin_lock_irqsave(shost->host_lock, flags);
> > > >  list_for_each_entry(sdev, &shost->__devices, siblings) {
> > > > -if (sdev->sdev_state == SDEV_DEL)
> > > > +if (sdev->sdev_state == SDEV_DEL ||
> > > > scsi_device_get(sdev)
> > > > < 0)
> > > >  continue;
> > > >  spin_unlock_irqrestore(shost->host_lock, flags);
> > > >  __scsi_remove_device(sdev);
> > > > +scsi_device_put(sdev);
> > > >  goto restart;
> > > >  }
> > > >  spin_unlock_irqrestore(shost->host_lock, flags);
> > > 
> > > Hello Laurence,
> > > 
> > > Did you run your tests with that patch applied? If so, it would help if
> > > you could rerun your tests without that patch. If the above patch makes
> > > a difference it means that it can happen that __scsi_remove_device()
> > > does not change the device state into SDEV_DEL. That's a bug and we need
> > > to know whether or not __scsi_remove_device() behaves correctly.
> > > 
> > > Thanks,
> > > 
> > > Bart.
> > > 
> > Yes Sir, I ran all yesterdays tests on your kernel with that patch applied.
> > Of course it may well just be luck/coincidence that the host delete race is
> > no longer happening
> > so I agree we need to re-run the tests so I will revert and re-run.
> > I will probably only get back to you tomorrow with the results.
> > 
> > Thanks
> > Laurence
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> > the body of a message to majord...@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > 
> Hello Bart
> 
> I only just got time now to revert that patch and build a kernel.
> Will test this tonight and let you know if I am back to seeing panics
> sporadically without the patch.
> As already mentioned, this is a different configuration to what I had when I
> was able to reproduce the panic.
> This means the lack of hitting this stack trace and panic may turn out to
> have nothing to do with the patch I applied.
> 
> Thanks
> Laurence
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Hello Bart

I can no longer reproduce the stack even with the patch reverted so its 
behaving as you expected and the patch is as you already said, not valid.
I ran about 30 fio tests with your kernel and multiple host deletions and and 
did experience only one hard fio error.
My tests now produce the same results as you are seeing.

The single fio errors was with many more executions of the test so its not easy 
to get these fio errors.

Away from tomorrow on vacation for 10 days

Thanks
Laurence

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


Re: [dm-devel] [PATCH 14/15] multipath-tools: replace queue-length by default selector

2016-08-11 Thread Xose Vazquez Perez
On 08/11/2016 07:58 AM, Hannes Reinecke wrote:

> On 08/10/2016 06:20 PM, Xose Vazquez Perez wrote:

>> service-time is more advanced, and it works better in asymmetric and
>> symmetric(corrected) environments.

>> -.selector  = "queue-length 0",

> I would _not_ do this, unless tested on the real hardware.
> Just claiming 'the other one is more advanced' is not enough here.

service-time works better in any wild environment, different adapters or
different links speeds and any kind of load, aka the Production Environment.
I guess that manufacturers' tests are done in ideal conditions(PV=nRT).

Anyhow, the default path selector algorithm does not depend, by no means, of
any array settings or hardware. It's only related to the Linux host and
its environment.

How PURE/FlashArray and XtremIO/XtremApp were tested? Is there anything
wrong with service-time?

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


Re: [dm-devel] [PATCH 2/4] multipath-tools: add checker callout to repair path

2016-08-11 Thread Bart Van Assche
On 08/08/2016 05:01 AM, Mike Christie wrote:
> This patch adds a callback which can be used to repair a path
> if check() has determined it is in the PATH_DOWN state.
> 
> The next patch that adds rbd checker support which will use this to
> handle the case where a rbd device is blacklisted.

Hello Mike,

With this patch applied, with the TUR checker enabled in multipath.conf
I see the following crash if I trigger SRP failover and failback:

ion-dev-ib-ini:~ # gdb ~bart/software/multipath-tools/multipathd/multipathd
(gdb) handle SIGPIPE noprint nostop
SignalStop  Print   Pass to program Description
SIGPIPE   NoNo  Yes Broken pipe
(gdb) run -d
Aug 11 08:46:27 | sde: remove path (uevent)
Aug 11 08:46:27 | mpathbe: adding map
Aug 11 08:46:27 | 8:64: cannot find block device
Aug 11 08:46:27 | Invalid device number 1
Aug 11 08:46:27 | 1: cannot find block device
Aug 11 08:46:27 | 8:96: cannot find block device
Aug 11 08:46:27 | mpathbe: failed to setup multipath
Aug 11 08:46:27 | dm-0: uev_add_map failed
Aug 11 08:46:27 | uevent trigger error

Thread 4 "multipathd" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x77f8b700 (LWP 8446)]
0x in ?? ()
(gdb) bt
#0  0x in ?? ()
#1  0x76c41905 in checker_repair (c=0x7fffdc001ef0) at checkers.c:225
#2  0x0040a760 in repair_path (vecs=0x66d7e0, pp=0x7fffdc001a40)
at main.c:1733
#3  0x0040ab27 in checkerloop (ap=0x66d7e0) at main.c:1807
#4  0x779bb474 in start_thread (arg=0x77f8b700)
at pthread_create.c:333
#5  0x763243ed in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb) up
#1  0x76c41905 in checker_repair (c=0x7fffdc001ef0) at checkers.c:225
225 c->repair(c);
(gdb) print *c
$1 = {node = {next = 0x0, prev = 0x0}, handle = 0x0, refcount = 0, fd = 0, 
  sync = 0, timeout = 0, disable = 0, name = '\000' , 
  message = '\000' , context = 0x0, mpcontext = 0x0, 
  check = 0x0, repair = 0x0, init = 0x0, free = 0x0}

Can you have a look at this?

Thanks,

Bart.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


[dm-devel] [PATCH] multipathd: fix some small bugs for cli socket

2016-08-11 Thread tang . junhui
From: "tang.junhui" 

1) mpath_recv_reply_len() should return error when the length which received by 
read_all() is wrong;
2) The buffer which *reply point to maybe null when mpath_recv_reply() return 
with success,
   so the caller needs to determine whether it is null, and then to use
   it.

Signed-off-by: tang.junhui 
---
 libmpathcmd/mpath_cmd.c | 2 +-
 multipathd/uxclnt.c | 3 +++
 multipathd/uxlsnr.c | 4 
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/libmpathcmd/mpath_cmd.c b/libmpathcmd/mpath_cmd.c
index 2290ecb..c058479 100644
--- a/libmpathcmd/mpath_cmd.c
+++ b/libmpathcmd/mpath_cmd.c
@@ -112,7 +112,7 @@ ssize_t mpath_recv_reply_len(int fd, unsigned int timeout)
return ret;
if (ret != sizeof(len)) {
errno = EIO;
-   return ret;
+   return -1;
}
return len;
 }
diff --git a/multipathd/uxclnt.c b/multipathd/uxclnt.c
index 62ff6f4..c5c32ea 100644
--- a/multipathd/uxclnt.c
+++ b/multipathd/uxclnt.c
@@ -28,6 +28,9 @@
 
 static void print_reply(char *s)
 {
+   if (!s)
+   return;
+
if (isatty(1)) {
printf("%s", s);
return;
diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c
index fa29b2a..7a9faf3 100644
--- a/multipathd/uxlsnr.c
+++ b/multipathd/uxlsnr.c
@@ -243,6 +243,10 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, 
void * trigger_data)
dead_client(c);
continue;
}
+   if (!inbuf) {
+   condlog(4, "recv_packet get null 
request");
+   continue;
+   }
condlog(4, "cli[%d]: Got request [%s]",
i, inbuf);
uxsock_trigger(inbuf, &reply, &rlen,
-- 
2.8.1.windows.1

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


Re: [dm-devel] [PATCH v2 1/1] block: fix blk_queue_split() resource exhaustion

2016-08-11 Thread Eric Wheeler
On Tue, 19 Jul 2016, Lars Ellenberg wrote:
> On Tue, Jul 12, 2016 at 10:32:33PM -0400, Mike Snitzer wrote:
> > On Tue, Jul 12 2016 at 10:18pm -0400,
> > Eric Wheeler  wrote:
> > 
> > > On Tue, 12 Jul 2016, NeilBrown wrote:
> > > 
> > > > On Tue, Jul 12 2016, Lars Ellenberg wrote:
> > > > 
> > > > >
> > > > > Instead, I suggest to distinguish between recursive calls to
> > > > > generic_make_request(), and pushing back the remainder part in
> > > > > blk_queue_split(), by pointing current->bio_lists to a
> > > > >   struct recursion_to_iteration_bio_lists {
> > > > >   struct bio_list recursion;
> > > > >   struct bio_list queue;
> > > > >   }
> > > > >
> > > > > By providing each q->make_request_fn() with an empty "recursion"
> > > > > bio_list, then merging any recursively submitted bios to the
> > > > > head of the "queue" list, we can make the recursion-to-iteration
> > > > > logic in generic_make_request() process deepest level bios first,
> > > > > and "sibling" bios of the same level in "natural" order.
> > > > >
> > > > > Signed-off-by: Lars Ellenberg 
> > > > > Signed-off-by: Roland Kammerer 
> > > > 
> > > > Reviewed-by: NeilBrown 
> > > > 
> > > > Thanks again for doing this - I think this is a very significant
> > > > improvement and could allow other simplifications.
> > > 
> > > Thank you Lars for all of this work!  
> > > 
> > > It seems like there have been many 4.3+ blockdev stacking issues and this 
> > > will certainly address some of those (maybe all of them?).  (I think we 
> > > hit this while trying drbd in 4.4 so we dropped back to 4.1 without 
> > > issue.)  It would be great to hear 4.4.y stable pick this up if 
> > > compatible.
> > > 
> > > 
> > > Do you believe that this patch would solve any of the proposals by others 
> > > since 4.3 related to bio splitting/large bios?  I've been collecting a 
> > > list, none of which appear have landed yet as of 4.7-rc7 (but correct me 
> > > if I'm wrong):

[... cut unrelated A,B ... ]

> > > C.  [1/3] block: flush queued bios when process blocks to avoid deadlock
> > >   by Mikulas Patocka: https://patchwork.kernel.org/patch/9204125/
> > >   (was https://patchwork.kernel.org/patch/7398411/)
> 
> As it stands now, this is yet an other issue, but related.
> 
> From the link above:
> 
> | ** Here is the dm-snapshot deadlock that was observed:
> | 
> | 1) Process A sends one-page read bio to the dm-snapshot target. The bio
> | spans snapshot chunk boundary and so it is split to two bios by device
> | mapper.
> | 
> | 2) Device mapper creates the first sub-bio and sends it to the snapshot
> | driver.
> | 
> | 3) The function snapshot_map calls track_chunk (that allocates a
> | structure
> | dm_snap_tracked_chunk and adds it to tracked_chunk_hash) and then remaps
> | the bio to the underlying device and exits with DM_MAPIO_REMAPPED.
> | 
> | 4) The remapped bio is submitted with generic_make_request, but it isn't
> | issued - it is added to current->bio_list instead.
> | 
> | 5) Meanwhile, process B (dm's kcopyd) executes pending_complete for the
> | chunk affected be the first remapped bio, it takes down_write(&s->lock)
> | and then loops in __check_for_conflicting_io, waiting for
> | dm_snap_tracked_chunk created in step 3) to be released.
> | 
> | 6) Process A continues, it creates a second sub-bio for the rest of the
> | original bio.
> 
> Aha.
> Here is the relation.
> If "A" had only ever processed "just the chunk it can handle now",
> and "pushed back" the rest of the incoming bio,
> it could rely on all deeper level bios to have been submitted already.
> 
> But this does not look like it easily fits into the current DM model.
> 
> | 7) snapshot_map is called for this new bio, it waits on
> | down_write(&s->lock) that is held by Process B (in step 5).
> 
> There is an other suggestion:
> Use down_trylock (or down_timeout),
> and if it fails, push back the currently to-be-processed bio.
> We can introduce a new bio helper for that.
> Kind of what blk_queue_split() does with my patch applied.
> 
> Or even better, ignore the down_trylock suggestion,
> simply not iterate over all pieces first,
> but process one piece, and return back the the
> iteration in generic_make_request.
> 
> A bit of conflict here may be that DM has all its own
> split and clone and queue magic, and wants to process
> "all of the bio" before returning back to generic_make_request().
> 
> To change that, __split_and_process_bio() and all its helpers
> would need to learn to "push back" (pieces of) the bio they are
> currently working on, and not push back via "DM_ENDIO_REQUEUE",
> but by bio_list_add_head(¤t->bio_lists->queue, piece_to_be_done_later).
> 
> Then, after they processed each piece,
> *return* all the way up to the top-level generic_make_request(),
> where the recursion-to-iteration logic would then
> make sure that all deeper level bios, submitted via
> recursive calls to generic_make_request() will be processed

[dm-devel] [PATCH] multipathd: extend the scope of vecs lock in uev_add_path

2016-08-11 Thread tang . wenjun3
From: 10144149 

when multipathd is processing add path1 uevent, just then do reconfigure,
There may be two path1 in pathvec.

Signed-off-by: 10144149 
---
 multipathd/main.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index f5e9a01..126ca2b 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -650,9 +650,8 @@ uev_add_path (struct uevent *uev, struct vectors * vecs)
}
}
}
-   lock_cleanup_pop(vecs->lock);
if (pp)
-   return ret;
+   goto out;
 
/*
 * get path vital state
@@ -662,14 +661,14 @@ uev_add_path (struct uevent *uev, struct vectors * vecs)
   DI_ALL, &pp);
put_multipath_config(conf);
if (!pp) {
-   if (ret == PATHINFO_SKIPPED)
-   return 0;
+   if (ret == PATHINFO_SKIPPED){
+   ret = 0;
+   goto out;
+   }
condlog(3, "%s: failed to get path info", uev->kernel);
-   return 1;
+   ret = 1;
+   goto out;
}
-   pthread_cleanup_push(cleanup_lock, &vecs->lock);
-   lock(vecs->lock);
-   pthread_testcancel();
ret = store_path(vecs->pathvec, pp);
if (!ret) {
conf = get_multipath_config();
@@ -683,6 +682,7 @@ uev_add_path (struct uevent *uev, struct vectors * vecs)
free_path(pp);
ret = 1;
}
+out:
lock_cleanup_pop(vecs->lock);
return ret;
 }
-- 
2.8.1.windows.1

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


Re: [dm-devel] vplex and multipath-tools

2016-08-11 Thread Christophe Varoqui
Thank you for this information.

Anyway, the "static path weight by serial" patch I merged solve the "not
easy to deploy site-wise" issue I raised ... in this particular vplex
topology.

For reference, more complex topologies would need new features Hannes and I
discussed earlier on the mailing-list (prioritizer stacking for example).

Regards,
Christophe

On Wed, Aug 10, 2016 at 10:36 PM, Xose Vazquez Perez  wrote:

> Christophe Varoqui wrote:
>
> > Hi Ed,
> >
> > does EMC have a specific prioritizer to select the local head in a vplex
> > cross-connect setup ?
> >
> > If not, would it be useful to develop one ? ... or does a particular
> setup
> > in multipath.conf suffices (not resorting to the weightedpath
> prioritizer,
> > which is not easy to deploy site-wise) ?
> >
> > If you are no longer the appropriate person to answer, please route me
> ...
>
> I believe he no longer works at EMC since long time ago.
>
> There are no recent traces at any ml: https://marc.info/?w=2&r=1&s=+
> Edward+Goggin&q=a
>
>
> EMC MTA server does not send back an unknown user message.
>
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel