From 0e6e3113f3bd48252fc053f7368ebcbbd9e14437 Mon Sep 17 00:00:00 2001 From: Christophe Varoqui Date: Thu, 13 Oct 2005 10:20:21 +0200 Subject: [PATCH] [multipath] Extension of the "no_path_retry" scope to the multipath Kiyoshi Ueda, NEC --- multipath.conf.annotated | 4 ++-- multipath/main.c | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/multipath.conf.annotated b/multipath.conf.annotated index 4acec94..3821063 100644 --- a/multipath.conf.annotated +++ b/multipath.conf.annotated @@ -102,7 +102,7 @@ # # # # # name : no_path_retry -# # scope : multipathd +# # scope : multipath & multipathd # # desc : tell the number of retries until disable queueing, or # # "fail" means immediate failure (no queueing), # # "queue" means never stop queueing @@ -191,7 +191,7 @@ # # # # # name : no_path_retry -# # scope : multipathd +# # scope : multipath & multipathd # # desc : tell the number of retries until disable queueing, or # # "fail" means immediate failure (no queueing), # # "queue" means never stop queueing diff --git a/multipath/main.c b/multipath/main.c index 9325632..e6d5c90 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -393,6 +393,7 @@ setup_map (struct multipath * mpp) select_features(mpp); select_hwhandler(mpp); select_rr_weight(mpp); + select_no_path_retry(mpp); /* * apply selected grouping policy to valid paths @@ -592,6 +593,12 @@ reinstate_paths (struct multipath * mpp) return 0; } +/* + * Return value: + * 0: DM_DEVICE_CREATE or DM_DEVICE_RELOAD failed, or dry_run mode. + * 1: DM_DEVICE_CREATE or DM_DEVICE_RELOAD succeeded. + * 2: Map is already existing. + */ static int domap (struct multipath * mpp) { @@ -607,7 +614,7 @@ domap (struct multipath * mpp) switch (mpp->action) { case ACT_NOTHING: - return 0; + return 2; case ACT_SWITCHPG: dm_switchgroup(mpp->alias, mpp->nextpg); @@ -617,7 +624,7 @@ domap (struct multipath * mpp) * retry. */ reinstate_paths(mpp); - return 0; + return 2; case ACT_CREATE: r = dm_addmap(DM_DEVICE_CREATE, mpp->alias, DEFAULT_TARGET, @@ -746,7 +753,13 @@ coalesce_paths (vector curmp, vector pathvec) condlog(3, "action set to %i", mpp->action); - domap(mpp); + if (domap(mpp) && mpp->no_path_retry != NO_PATH_RETRY_UNDEF) { + if (mpp->no_path_retry == NO_PATH_RETRY_FAIL) + dm_queue_if_no_path(mpp->alias, 0); + else + dm_queue_if_no_path(mpp->alias, 1); + } + next: drop_multipath(curmp, mpp->wwid, KEEP_PATHS); free_multipath(mpp, KEEP_PATHS); -- 2.7.4