Re: [dm-devel] [PATCH 07/15] multipathd: Fix a data race

2016-10-07 Thread tang . junhui
Hello Bart,
This patch solved the data race problem,
but the assignment for paths check interval has no effect,
since there is no path in vecs when calling init_path_check_interval(vecs) 
in child(),
I think it is better to call  init_path_check_interval(vecs) at 
reconfigure() or configure() 
after the paths has created in vecs .

Thanks,
Tang





发件人: Bart Van Assche 
收件人: Christophe Varoqui , 
抄送:   device-mapper development 
日期:   2016/10/05 01:45
主题:   [dm-devel] [PATCH 07/15] multipathd: Fix a data race
发件人: dm-devel-boun...@redhat.com



Avoid that the path check interval initialization loop races with
other code that accesses the path vectors by executing that code
on the context of the main thread instead of the checker loop.
This patch avoids that DRD reports the following:

Conflicting store by thread 1 at 0x07f3f1f8 size 8
   at 0x40B50C: reconfigure (main.c:2014)
   by 0x40C2EC: child (main.c:2371)
   by 0x40CDA1: main (main.c:2609)
Address 0x7f3f1f8 is at offset 40 from 0x7f3f1d0. Allocation context:
   at 0x4C32995: calloc (in 
/usr/lib64/valgrind/vgpreload_drd-amd64-linux.so)
   by 0x5DDAC36: zalloc (memory.c:34)
   by 0x40B61A: init_vecs (main.c:2043)
   by 0x40BF01: child (main.c:2295)
   by 0x40CDA1: main (main.c:2609)

Signed-off-by: Bart Van Assche 
---
 multipathd/main.c | 24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index 3030e85..cdfafe8 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1742,6 +1742,19 @@ check_path (struct vectors * vecs, struct path * 
pp, int ticks)
 return 1;
 }
 
+static void init_path_check_interval(struct vectors *vecs)
+{
+struct config *conf;
+struct path *pp;
+unsigned int i;
+
+vector_foreach_slot (vecs->pathvec, pp, i) {
+conf = get_multipath_config();
+pp->checkint = conf->checkint;
+put_multipath_config(conf);
+}
+}
+
 static void *
 checkerloop (void *ap)
 {
@@ -1759,15 +1772,6 @@ checkerloop (void *ap)
 vecs = (struct vectors *)ap;
 condlog(2, "path checkers start up");
 
-/*
- * init the path check interval
- */
-vector_foreach_slot (vecs->pathvec, pp, i) {
-conf = get_multipath_config();
-pp->checkint = conf->checkint;
-put_multipath_config(conf);
-}
-
 /* Tweak start time for initial path check */
 if (clock_gettime(CLOCK_MONOTONIC, &last_time) != 0)
 last_time.tv_sec = 0;
@@ -2327,6 +2331,8 @@ child (void * param)
  */
 post_config_state(DAEMON_CONFIGURE);
 
+init_path_check_interval(vecs);
+
 /*
  * Start uevent listener early to catch events
  */
-- 
2.10.0

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


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

Re: [dm-devel] [PATCH 00/15] Fifteen multipath-tools patches

2016-10-07 Thread tang.junhui
Hello Bart,



"0007-multipathd-Fix-a-data-race.patch"

This patch solved the data race problem, 

but the assignment for paths check interval has no effect,

since there is no path in vecs when calling init_path_check_interval(vecs) in 
child(),

I think it is better to call  init_path_check_interval(vecs) at reconfigure() 
or configure() 

after the paths has created in vecs .




Thanks,

Tang























原始邮件



发件人:ChristopheVaroqui
收件人:Bart Van Assche
抄送人:device-mapper development
日 期 :2016年10月05日 14:56
主 题 :Re: [dm-devel] [PATCH 00/15] Fifteen multipath-tools patches





The set is merged.I just added a patch to fix the drd include in debug.c

Thanks,
Christophe




On Tue, Oct 4, 2016 at 7:36 PM, Bart Van Assche <bart.vanass...@sandisk.com> 
wrote:
Hello Christophe,
 
 As promised I am sending you the multipath-tools patches from my local 
repository. The names of these patches are:
 
 0001-libmultipath-prioritizers-ontap-Remove-an-unused-inc.patch
 0002-libmultipath-memory-Move-an-include-directive.patch
 0003-libmultipath-checkers-tur-Declare-local-functions-st.patch
 0004-libmultipath-checkers-rbd-Declare-local-functions-st.patch
 0005-multipathd-libmultipathd-Make-delays-independent-of-.patch
 0006-multipathd-Suppress-uninteresting-data-race-reports.patch
 0007-multipathd-Fix-a-data-race.patch
 0008-libmultipath-checkers-tur-Introduce-strlcpy.patch
 0009-libmultipath-checkers-tur-Terminate-a-statement-with.patch
 0010-libmultipath-checkers-tur-Move-pthread_attr_destroy-.patch
 0011-libmultipath-checkers-tur-Protect-tur_checker_contex.patch
 0012-libmultipath-checkers-tur-Serialize-tur_checker_cont.patch
 0013-libmultipath-checkers-tur-Fix-races-on-tur_checker_c.patch
 0014-libmultipath-Micro-optimize-snprint_size.patch
 0015-Makefile.inc-Enable-Wextra-and-Wformat-nonliteral.patch
 
 Thanks,
 
 Bart.--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [git pull] device mapper changes for 4.9

2016-10-07 Thread Mike Snitzer
Hi Linus,

These DM changes for 4.9 build ontop of Jens' 'for-4.9/block' branch due
to dependency on the new blk_mq_delay_kick_requeue_list().

The following changes since commit 2849450ad39d2e699fda2d5c6f41e05d87fd7004:

  blk-mq: introduce blk_mq_delay_kick_requeue_list() (2016-09-14 11:48:34 -0600)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm 
tags/dm-4.9-changes

for you to fetch changes up to 8ff232c1a819c2e98d85974a3bff0b7b8e2970ed:

  dm mpath: always return reservation conflict without failing over (2016-09-29 
10:57:07 -0400)

Please pull, thanks.
Mike


. various fixes and cleanups for request-based DM core

. add support for delaying the requeue of requests; used by DM multipath
  when all paths have failed and 'queue_if_no_path' is enabled

. DM cache improvements to speedup the loading metadata and the writing
  of the hint array

. fix potential for a dm-crypt crash on device teardown

. remove dm_bufio_cond_resched() and just using cond_resched()

. change DM multipath to return a reservation conflict error
  immediately; rather than failing the path and retrying (potentially
  indefinitely)


Bart Van Assche (7):
  dm: mark request_queue dead before destroying the DM device
  dm rq: factor out dm_mq_stop_queue()
  dm rq: simplify dm_old_stop_queue()
  dm: add two lockdep_assert_held() statements
  dm: rename task state function arguments
  dm: use signal_pending_state() in dm_wait_for_completion()
  dm: convert wait loops to use autoremove_wake_function()

Hannes Reinecke (1):
  dm mpath: always return reservation conflict without failing over

Joe Thornber (6):
  dm array: add dm_array_new()
  dm cache: speed up writing of the hint array
  dm cache policy smq: distribute entries to random levels when switching 
to smq
  dm btree: introduce cursor api
  dm array: introduce cursor api
  dm cache metadata: switch to using the new cursor api for loading metadata

Mike Snitzer (7):
  dm rq: take request_queue lock while clearing QUEUE_FLAG_STOPPED
  dm mpath: check if path's request_queue is dying in activate_path()
  dm rq: add DM_MAPIO_DELAY_REQUEUE to delay requeue of blk-mq requests
  dm rq: reduce arguments passed to map_request() and 
dm_requeue_original_request()
  dm rq: introduce dm_mq_kick_requeue_list()
  dm mpath: use dm_mq_kick_requeue_list()
  dm mpath: delay the requeue of blk-mq requests while all paths down

Minfei Huang (1):
  dm: return correct error code in dm_resume()'s retry loop

Peter Zijlstra (1):
  dm bufio: remove dm_bufio_cond_resched()

Rabin Vincent (1):
  dm crypt: fix crash on exit

 drivers/md/dm-bufio.c |  31 ++---
 drivers/md/dm-cache-metadata.c| 183 +++
 drivers/md/dm-cache-policy-cleaner.c  |   2 +-
 drivers/md/dm-cache-policy-internal.h |   6 +-
 drivers/md/dm-cache-policy-smq.c  |  45 ++-
 drivers/md/dm-cache-policy.h  |  10 +-
 drivers/md/dm-crypt.c |  24 ++--
 drivers/md/dm-mpath.c |  59 -
 drivers/md/dm-rq.c| 104 ++--
 drivers/md/dm-rq.h|   2 +
 drivers/md/dm.c   |  37 +++---
 drivers/md/persistent-data/dm-array.c | 228 +-
 drivers/md/persistent-data/dm-array.h |  52 
 drivers/md/persistent-data/dm-btree.c | 162 
 drivers/md/persistent-data/dm-btree.h |  35 ++
 include/linux/device-mapper.h |   1 +
 16 files changed, 716 insertions(+), 265 deletions(-)

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


[dm-devel] [PATCH] scsi: update rdac devices at scsi_dh_rdac

2016-10-07 Thread Xose Vazquez Perez
Remove IBM/1745 ghost array.
There is no references nowhere, also removed from multipath-tools
Confirmed by the original manufacturer(NetApp), and Google shows no results.

Replace too wide "TP9" regex with full names.
TP9100 is included, at it is not a RDAC array.
This reverts partially the commit 352047

Add IBM 3542 and 3552, they are FAStT200 and FAStT500

Cc: Sean Stewart 
Cc: Hannes Reinecke 
Cc: Christophe Varoqui 
Cc: James E.J. Bottomley 
Cc: Martin K. Petersen 
Cc: SCSI ML 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 drivers/scsi/scsi_dh.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/scsi_dh.c b/drivers/scsi/scsi_dh.c
index b8d3b97..a64b5ce 100644
--- a/drivers/scsi/scsi_dh.c
+++ b/drivers/scsi/scsi_dh.c
@@ -49,14 +49,18 @@ static const struct scsi_dh_blist scsi_dh_blist[] = {
{"IBM", "1724", "rdac", },
{"IBM", "1726", "rdac", },
{"IBM", "1742", "rdac", },
-   {"IBM", "1745", "rdac", },
{"IBM", "1746", "rdac", },
{"IBM", "1813", "rdac", },
{"IBM", "1814", "rdac", },
{"IBM", "1815", "rdac", },
{"IBM", "1818", "rdac", },
{"IBM", "3526", "rdac", },
-   {"SGI", "TP9",  "rdac", },
+   {"IBM", "3542", "rdac", },
+   {"IBM", "3552", "rdac", },
+   {"SGI", "TP9300",   "rdac", },
+   {"SGI", "TP9400",   "rdac", },
+   {"SGI", "TP9500",   "rdac", },
+   {"SGI", "TP9700",   "rdac", },
{"SGI", "IS",   "rdac", },
{"STK", "OPENstorage D280", "rdac", },
{"STK", "FLEXLINE 380", "rdac", },
-- 
2.10.1

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


[dm-devel] [PATCH] scsi: replace wrong device handler name for CLARiiON arrays

2016-10-07 Thread Xose Vazquez Perez
At drivers/scsi/device_handler/scsi_dh_emc.c it was defined as:
#define CLARIION_NAME   "emc"

Cc: Christoph Hellwig 
Cc: Hannes Reinecke 
Cc: Christophe Varoqui 
Cc: James E.J. Bottomley 
Cc: Martin K. Petersen 
Cc: SCSI ML 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 drivers/scsi/scsi_dh.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/scsi_dh.c b/drivers/scsi/scsi_dh.c
index 54d446c..b8d3b97 100644
--- a/drivers/scsi/scsi_dh.c
+++ b/drivers/scsi/scsi_dh.c
@@ -36,9 +36,9 @@ struct scsi_dh_blist {
 };
 
 static const struct scsi_dh_blist scsi_dh_blist[] = {
-   {"DGC", "RAID", "clariion" },
-   {"DGC", "DISK", "clariion" },
-   {"DGC", "VRAID","clariion" },
+   {"DGC", "RAID", "emc" },
+   {"DGC", "DISK", "emc" },
+   {"DGC", "VRAID","emc" },
 
{"COMPAQ", "MSA1000 VOLUME","hp_sw" },
{"COMPAQ", "HSV110","hp_sw" },
-- 
2.10.1

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


Re: [dm-devel] [PATCH] multipath-tools: add IBM/FlashSystem to hwtable

2016-10-07 Thread Steffen Maier

On 10/07/2016 03:15 PM, Xose Vazquez Perez wrote:

System  Vendor Product  Multipathing Policy
=== ==  ===
FlashSystem 710 IBMFlashSystem  Symmetric Active/Active
FlashSystem 720 IBMFlashSystem  Symmetric Active/Active
FlashSystem 810 IBMFlashSystem  Symmetric Active/Active
FlashSystem 820 IBMFlashSystem  Symmetric Active/Active
FlashSystem 840 IBMFlashSystem-9840 Symmetric Active/Active
FlashSystem 900 IBMFlashSystem-9840 Symmetric Active/Active

Based on documentation from the manufacturer:
http://www.redbooks.ibm.com/redbooks/pdfs/sg248271.pdf


IBM RedBooks are more like descriptions for one particular use case as 
described in the book rather than reference manuals.


Product documentation is elsewhere and also updated more often (like 
each product release) than a RedBook.

E.g. for IBM FlashSystem 900:
http://www.ibm.com/support/knowledgecenter/STKMQB/com.ibm.storage.flashsystem900.1.2.doc/tms_multipathing.html

You'll notice that we from Linux on s390x have a bit different 
recommendations for some of the values (no_path_retry actually depends 
on whether you have a cluster software/filesystem that can cope with EIO 
on last-path-loss. Currently, I see the default without that, i.e. 
non-clustered from which we would like to hide any path issues).


Is there some way to have "dependent" settings?


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

diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index e1b055a..ff6989d 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -522,6 +522,13 @@ static struct hwentry default_hw[] = {
.no_path_retry = NO_PATH_RETRY_QUEUE,
.pgpolicy  = MULTIBUS,
},
+   {
+   /* FlashSystem 710/720/810/820/840/900 */
+   .vendor= "IBM",
+   .product   = "FlashSystem",
+   .no_path_retry = NO_PATH_RETRY_FAIL,
+   .pgpolicy  = MULTIBUS,
+   },
/*
 * IBM Power Virtual SCSI Devices
 *



--
Mit freundlichen Grüßen / Kind regards
Steffen Maier

Linux on z Systems Development

IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


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


Re: [dm-devel] [PATCH] multipath-tools: add NexGen arrays to hwtable

2016-10-07 Thread Xose Vazquez Perez
On 10/07/2016 03:33 PM, Xose Vazquez Perez wrote:

> Based on info provided by the manufacturer.

Please drop this one, replaced by v2.
Thank you.

> Cc: Brian Auld 
> Cc: Bart Brooks 
> Cc: Christophe Varoqui 
> Cc: device-mapper development 
> Signed-off-by: Xose Vazquez Perez 
> ---
>  libmultipath/hwtable.c | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
> index ff6989d..5ec63c8 100644
> --- a/libmultipath/hwtable.c
> +++ b/libmultipath/hwtable.c
> @@ -776,6 +776,14 @@ static struct hwentry default_hw[] = {
>   .no_path_retry = NO_PATH_RETRY_QUEUE,
>   .pgpolicy  = MULTIBUS,
>   },
> + {
> + .vendor= "(NexGen|Pivot3)",
> + .product   = "TierStore",
> + .pgpolicy  = GROUP_BY_PRIO,
> + .pgfailback= -FAILBACK_IMMEDIATE,
> + .prio_name = PRIO_ALUA,
> + .no_path_retry = NO_PATH_RETRY_QUEUE,
> + },
>   /*
>* Intel
>*/
> 

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


[dm-devel] [PATCH v2] multipath-tools: add NexGen arrays to hwtable

2016-10-07 Thread Xose Vazquez Perez
Based on info provided by the manufacturer.

Cc: Brian Auld 
Cc: Bart Brooks 
Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
v2 add vSTAC
---
 libmultipath/hwtable.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index ff6989d..637be3d 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -776,6 +776,14 @@ static struct hwentry default_hw[] = {
.no_path_retry = NO_PATH_RETRY_QUEUE,
.pgpolicy  = MULTIBUS,
},
+   {
+   .vendor= "(NexGen|Pivot3)",
+   .product   = "(TierStore|vSTAC)",
+   .pgpolicy  = GROUP_BY_PRIO,
+   .pgfailback= -FAILBACK_IMMEDIATE,
+   .prio_name = PRIO_ALUA,
+   .no_path_retry = NO_PATH_RETRY_QUEUE,
+   },
/*
 * Intel
 */
-- 
2.10.1

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


[dm-devel] [PATCH] multipath-tools: add NexGen arrays to hwtable

2016-10-07 Thread Xose Vazquez Perez
Based on info provided by the manufacturer.

Cc: Brian Auld 
Cc: Bart Brooks 
Cc: Christophe Varoqui 
Cc: device-mapper development 
Signed-off-by: Xose Vazquez Perez 
---
 libmultipath/hwtable.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index ff6989d..5ec63c8 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -776,6 +776,14 @@ static struct hwentry default_hw[] = {
.no_path_retry = NO_PATH_RETRY_QUEUE,
.pgpolicy  = MULTIBUS,
},
+   {
+   .vendor= "(NexGen|Pivot3)",
+   .product   = "TierStore",
+   .pgpolicy  = GROUP_BY_PRIO,
+   .pgfailback= -FAILBACK_IMMEDIATE,
+   .prio_name = PRIO_ALUA,
+   .no_path_retry = NO_PATH_RETRY_QUEUE,
+   },
/*
 * Intel
 */
-- 
2.10.1

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


[dm-devel] [PATCH] multipath-tools: add IBM/FlashSystem to hwtable

2016-10-07 Thread Xose Vazquez Perez
System  Vendor Product  Multipathing Policy
=== ==  ===
FlashSystem 710 IBMFlashSystem  Symmetric Active/Active
FlashSystem 720 IBMFlashSystem  Symmetric Active/Active
FlashSystem 810 IBMFlashSystem  Symmetric Active/Active
FlashSystem 820 IBMFlashSystem  Symmetric Active/Active
FlashSystem 840 IBMFlashSystem-9840 Symmetric Active/Active
FlashSystem 900 IBMFlashSystem-9840 Symmetric Active/Active

Based on documentation from the manufacturer:
http://www.redbooks.ibm.com/redbooks/pdfs/sg248271.pdf

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

diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index e1b055a..ff6989d 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -522,6 +522,13 @@ static struct hwentry default_hw[] = {
.no_path_retry = NO_PATH_RETRY_QUEUE,
.pgpolicy  = MULTIBUS,
},
+   {
+   /* FlashSystem 710/720/810/820/840/900 */
+   .vendor= "IBM",
+   .product   = "FlashSystem",
+   .no_path_retry = NO_PATH_RETRY_FAIL,
+   .pgpolicy  = MULTIBUS,
+   },
/*
 * IBM Power Virtual SCSI Devices
 *
-- 
2.10.1

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