Skip to contentSkip to conversation

multipathd: fail path when path check timeout

PATCH In review [email protected] 3 participants 5 messages Aug 10, 2016 – Oct 12, 2016 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 multipathd: fail path when path check timeout

From: "tang.junhui" <[email protected]>

path should be failed when path status is PATH_TIMEOUT after check, otherwise, the valid number of paths in the map would be increased when the path status is PATH_UP after the next turn check, which would cause the valid number of paths exceeding the total number of paths in the map.

---
 multipathd/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
multipathd/main.c +1 -1
index f5e9a01..01f1e58 100644
@@ -1585,7 +1585,7 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
 		pp->checkint = conf->checkint;
 		put_multipath_config(conf);
 
-		if (newstate == PATH_DOWN || newstate == PATH_SHAKY) {
+		if (newstate == PATH_DOWN || newstate == PATH_SHAKY || newstate == PATH_TIMEOUT) {
 			/*
 			 * proactively fail path in the DM
 			 */
Signature · 1 line
2.8.1.windows.1
#1 lore raw

Please have a review for this patch, any comment will be highly appreciated.

发件人: [email protected]
收件人: christophe varoqui <[email protected]>,
抄送: [email protected], [email protected], "tang.junhui"
<[email protected]>
日期: 2016/08/10 16:11
主题: [PATCH] multipathd: fail path when path check timeout

From: "tang.junhui" <[email protected]>

path should be failed when path status is PATH_TIMEOUT after check, otherwise, the valid number of paths in the map would be increased when the path status is PATH_UP after the next turn check, which would cause the valid number of paths exceeding the total number of paths in the map.

---
 multipathd/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
multipathd/main.c +0 -0
index f5e9a01..01f1e58 100644
@@ -1585,7 +1585,7 @@ check_path (struct vectors * vecs, struct path * pp, 

int ticks)

                                 pp->checkint = conf->checkint;
                                 put_multipath_config(conf);

- if (newstate == PATH_DOWN || newstate ==
PATH_SHAKY) {
+ if (newstate == PATH_DOWN || newstate ==
PATH_SHAKY || newstate == PATH_TIMEOUT) {
/*
* proactively fail path
in the DM

                                                  */
Signature · 1 line
2.8.1.windows.1
#2 lore raw

Merged.
Thanks.

Quoted 50 lines · On Tue, Oct 11, 2016 at 8:50 AM, <[email protected]> wrote:

Please have a review for this patch, any comment will be highly appreciated.

发件人: [email protected]
收件人: christophe varoqui <[email protected]>,
抄送: [email protected], [email protected], "tang.junhui" <
[email protected]>
日期: 2016/08/10 16:11
主题: [PATCH] multipathd: fail path when path check timeout
------------------------------

From: "tang.junhui" <[email protected]>

path should be failed when path status is PATH_TIMEOUT after check, otherwise, the valid number of paths in the map would be increased when the path status is PATH_UP after the next turn check, which would cause the valid number of paths exceeding the total number of paths in the map.

---
multipathd/main.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
multipathd/main.c +1 -1
index f5e9a01..01f1e58 100644
@@ -1585,7 +1585,7 @@ check_path (struct vectors * vecs, struct path * pp,
 int ticks)
                                  pp->checkint = conf->checkint;
                                  put_multipath_config(conf);
 
-                                  if (newstate == PATH_DOWN || newstate
 == PATH_SHAKY) {
+                                  if (newstate == PATH_DOWN || newstate
 == PATH_SHAKY || newstate == PATH_TIMEOUT) {

/*
* proactively fail
path in the DM

                                                    */

--
2.8.1.windows.1

#3 lore raw
In reply to [email protected]
Quoted 2 lines · On Tue, Oct 11, 2016 at 02:50:00PM +0800, [email protected] wrote:

Please have a review for this patch, any comment will be highly appreciated.

This is clearly correct. I suspect that there will be other places where we need to also check for PATH_TIMEOUT, since it is basically the same as PATH_DOWN, except with a different state name. For instance, we only log error messages on repeated checks for (newstate == PATH_DOWN), and we should probably do that for PATH_TIMEOUT as well. There are probably more instances outside of check_path.

-Ben

Quoted 33 lines

������:         [email protected]
�ռ���:         christophe varoqui <[email protected]>, ����:        [email protected], [email protected], "tang.junhui" <[email protected]>
����:         2016/08/10 16:11
����:        [PATCH] multipathd: fail path when path check timeout

   --------------------------------------------------------------------------

   From: "tang.junhui" <[email protected]>

   path should be failed when path status is PATH_TIMEOUT after check,
   otherwise, the valid number of paths in the map would be increased when
   the path status is PATH_UP after the next turn check, which would cause
   the valid number of paths exceeding the total number of paths in the map.

   Signed-off-by: tang.junhui <[email protected]>
   ---
   multipathd/main.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

   diff --git a/multipathd/main.c b/multipathd/main.c
   index f5e9a01..01f1e58 100644
   --- a/multipathd/main.c
   +++ b/multipathd/main.c
   @@ -1585,7 +1585,7 @@ check_path (struct vectors * vecs, struct path * pp,
   int ticks)
                                     pp->checkint = conf->checkint;
                                     put_multipath_config(conf);

   -                                  if (newstate == PATH_DOWN || newstate
   == PATH_SHAKY) {
Quoted 8 lines
   +                                  if (newstate == PATH_DOWN || newstate
   == PATH_SHAKY || newstate == PATH_TIMEOUT) {
                                                      /*
                                                       * proactively fail
   path in the DM
                                                       */
   --
   2.8.1.windows.1

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

#4 lore raw

Hello, Ben

Thanks for your review,
This problem is found by our automatic testing,
I will spend more time to correct other similar bugs in the next patch。

Cheers,
Tang

发件人: "Benjamin Marzinski" <[email protected]>
收件人: [email protected],
抄送: [email protected], [email protected],
[email protected]
日期: 2016/10/12 11:02
主题: Re: [dm-devel] [PATCH] multipathd: fail path when path check
timeout
发件人: [email protected]

Quoted 2 lines · On Tue, Oct 11, 2016 at 02:50:00PM +0800, [email protected] wrote:

Please have a review for this patch, any comment will be highly appreciated.

This is clearly correct. I suspect that there will be other places where we need to also check for PATH_TIMEOUT, since it is basically the same as PATH_DOWN, except with a different state name. For instance, we only log error messages on repeated checks for (newstate == PATH_DOWN), and we should probably do that for PATH_TIMEOUT as well. There are probably more instances outside of check_path.

-Ben

Quoted 4 lines

������: [email protected]
�ռ���: christophe varoqui <[email protected]>,
����: [email protected], [email protected],

"tang.junhui"

Quoted 3 lines

<[email protected]>
����: 2016/08/10 16:11
����: [PATCH] multipathd: fail path when path check

timeout

Quoted 2 lines

--------------------------------------------------------------------------

Quoted 5 lines

From: "tang.junhui" <[email protected]>

path should be failed when path status is PATH_TIMEOUT after check, otherwise, the valid number of paths in the map would be increased

when

Quoted 1 line

the path status is PATH_UP after the next turn check, which would

cause

Quoted 1 line

the valid number of paths exceeding the total number of paths in the

map.

Quoted 11 lines
   Signed-off-by: tang.junhui <[email protected]>
   ---
   multipathd/main.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

   diff --git a/multipathd/main.c b/multipathd/main.c
   index f5e9a01..01f1e58 100644
   --- a/multipathd/main.c
   +++ b/multipathd/main.c
   @@ -1585,7 +1585,7 @@ check_path (struct vectors * vecs, struct path 

* pp,

Quoted 5 lines
   int ticks)
                                     pp->checkint = conf->checkint;
                                     put_multipath_config(conf);

- if (newstate == PATH_DOWN ||

newstate

Quoted 2 lines

== PATH_SHAKY) {
+ if (newstate == PATH_DOWN ||

newstate

Quoted 3 lines
   == PATH_SHAKY || newstate == PATH_TIMEOUT) {
                                                      /*
                                                       * proactively 

fail

Quoted 4 lines
   path in the DM
                                                       */
   --
   2.8.1.windows.1

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel