From 6163a22313853ac43768e33b49e79484ab3ac634 Mon Sep 17 00:00:00 2001 From: tangjunhui <110950397@qq.com> Date: Mon, 28 Dec 2015 15:20:58 +0800 Subject: [PATCH 1/5] Check path only if path reinstate successfully when reinstating path by CLI We fail a path, and suspend the map which the path belongs to, then reinstate the path by CLI and it returned with a fail message, the problem is: 1) There is a lot of log messages that indicate the path status is up but reinstate fail; 2) When we resume the map, the path change status to active from failed automatically though it's failed when we reinstated path before. --- multipathd/cli_handlers.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index a44281f9d..dea92c5db 100644 --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c @@ -888,6 +888,7 @@ cli_reinstate(void * v, char ** reply, int * len, void * data) struct vectors * vecs = (struct vectors *)data; char * param = get_keyparam(v, PATH); struct path * pp; + int r; param = convert_dev(param, 1); pp = find_path_by_dev(vecs->pathvec, param); @@ -901,8 +902,14 @@ cli_reinstate(void * v, char ** reply, int * len, void * data) condlog(2, "%s: reinstate path %s (operator)", pp->mpp->alias, pp->dev_t); - checker_enable(&pp->checker); - return dm_reinstate_path(pp->mpp->alias, pp->dev_t); + r = dm_reinstate_path(pp->mpp->alias, pp->dev_t); + /* + * Check path only if reinstat path successfull + */ + if (!r) + checker_enable(&pp->checker); + + return r; } int From d74f32a20368a3263b80fa95af4591c926be3a34 Mon Sep 17 00:00:00 2001 From: tangjunhui <110950397@qq.com> Date: Tue, 29 Dec 2015 18:39:54 +0800 Subject: [PATCH 2/5] Add default configuration for ZTE storage poduct Add default configuration for ZXUSP series products of ZTE SAN storage such as KS3200, KS5200. --- multipath.conf.defaults | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/multipath.conf.defaults b/multipath.conf.defaults index a4e8f7580..50831d8ad 100644 --- a/multipath.conf.defaults +++ b/multipath.conf.defaults @@ -940,6 +940,23 @@ # rr_weight "uniform" # no_path_retry "queue" # } +# device { +# vendor "ZTE" +# product "ZXUSP" +# features "1 queue_if_no_path" +# path_grouping_policy "group_by_prio" +# path_selector "round-robin 0" +# path_checker "tur" +# hardware_handler "1 alua" +# prio "alua" +# failback "immediate" +# rr_weight "uniform" +# no_path_retry 20 +# rr_min_io_rq 1 +# flush_on_last_del "yes" +# fast_io_fail_tmo 5 +# dev_loss_tmo 60 +# } #} #multipaths { #} From e3cbe0ba81c2b28d68b0e372f62d85c7f4575860 Mon Sep 17 00:00:00 2001 From: tangjunhui <110950397@qq.com> Date: Tue, 29 Dec 2015 18:43:46 +0800 Subject: [PATCH 3/5] Add default configuration for ZTE storage product Add default configuration for ZXUSP series products of ZTE SAN storage such as KS3200, KS5200. --- libmultipath/hwtable.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c index fa4b20f86..84472d274 100644 --- a/libmultipath/hwtable.c +++ b/libmultipath/hwtable.c @@ -1166,6 +1166,23 @@ static struct hwentry default_hw[] = { .prio_name = PRIO_ALUA, .prio_args = NULL, }, + { + .vendor = "ZTE", + .product = "ZXUSP", + .features = "1 queue_if_no_path", + .pgpolicy = GROUP_BY_PRIO, + .selector = "round-robin 0" + .checker_name = TUR, + .hwhandler = "1 alua", + .prio_name = PRIO_ALUA, + .pgfailback = -FAILBACK_IMMEDIATE, + .rr_weight = RR_WEIGHT_NONE, + .no_path_retry = 20, + .minio_rq = 1, + .flush_on_last_del = FLUSH_ENABLED, + .fast_io_fail = 5, + .dev_loss = 60, + }, /* * EOL */ From 201caee522fcdad26ec83d5e0250326e62897a1b Mon Sep 17 00:00:00 2001 From: tangjunhui <110950397@qq.com> Date: Tue, 29 Dec 2015 18:59:27 +0800 Subject: [PATCH 4/5] Update cli_handlers.c --- multipathd/cli_handlers.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index dea92c5db..d8e6c4975 100644 --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c @@ -885,31 +885,24 @@ cli_resume(void * v, char ** reply, int * len, void * data) int cli_reinstate(void * v, char ** reply, int * len, void * data) { - struct vectors * vecs = (struct vectors *)data; - char * param = get_keyparam(v, PATH); - struct path * pp; - int r; + struct vectors * vecs = (struct vectors *)data; + char * param = get_keyparam(v, PATH); + struct path * pp; - param = convert_dev(param, 1); - pp = find_path_by_dev(vecs->pathvec, param); + param = convert_dev(param, 1); + pp = find_path_by_dev(vecs->pathvec, param); - if (!pp) - pp = find_path_by_devt(vecs->pathvec, param); + if (!pp) + pp = find_path_by_devt(vecs->pathvec, param); - if (!pp || !pp->mpp || !pp->mpp->alias) - return 1; + if (!pp || !pp->mpp || !pp->mpp->alias) + return 1; - condlog(2, "%s: reinstate path %s (operator)", - pp->mpp->alias, pp->dev_t); + condlog(2, "%s: reinstate path %s (operator)", + pp->mpp->alias, pp->dev_t); - r = dm_reinstate_path(pp->mpp->alias, pp->dev_t); - /* - * Check path only if reinstat path successfull - */ - if (!r) - checker_enable(&pp->checker); - - return r; + checker_enable(&pp->checker); + return dm_reinstate_path(pp->mpp->alias, pp->dev_t); } int From 871288ea9e7d96f607bd353510c51208cd9b1072 Mon Sep 17 00:00:00 2001 From: tangjunhui <110950397@qq.com> Date: Tue, 29 Dec 2015 19:06:43 +0800 Subject: [PATCH 5/5] Update cli_handlers.c --- multipathd/cli_handlers.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index d8e6c4975..a44281f9d 100644 --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c @@ -885,24 +885,24 @@ cli_resume(void * v, char ** reply, int * len, void * data) int cli_reinstate(void * v, char ** reply, int * len, void * data) { - struct vectors * vecs = (struct vectors *)data; - char * param = get_keyparam(v, PATH); - struct path * pp; + struct vectors * vecs = (struct vectors *)data; + char * param = get_keyparam(v, PATH); + struct path * pp; - param = convert_dev(param, 1); - pp = find_path_by_dev(vecs->pathvec, param); + param = convert_dev(param, 1); + pp = find_path_by_dev(vecs->pathvec, param); - if (!pp) - pp = find_path_by_devt(vecs->pathvec, param); + if (!pp) + pp = find_path_by_devt(vecs->pathvec, param); - if (!pp || !pp->mpp || !pp->mpp->alias) - return 1; + if (!pp || !pp->mpp || !pp->mpp->alias) + return 1; - condlog(2, "%s: reinstate path %s (operator)", - pp->mpp->alias, pp->dev_t); + condlog(2, "%s: reinstate path %s (operator)", + pp->mpp->alias, pp->dev_t); - checker_enable(&pp->checker); - return dm_reinstate_path(pp->mpp->alias, pp->dev_t); + checker_enable(&pp->checker); + return dm_reinstate_path(pp->mpp->alias, pp->dev_t); } int