From 960e702a6eebc85cdde98ab1d5d23f8a6ba828a6 Mon Sep 17 00:00:00 2001
From: deen <deen>
Date: Wed, 5 Mar 2008 18:06:08 +0000
Subject: [PATCH] When the failover node is the primary node, it is possible to
 have two identical connections in imp_conn_list. We must compare not conn's
 pointers but NIDs, otherwise we can defeat connection throttling.

b=14774
i=adilger
i=johann
---
 lustre/ChangeLog       | 8 ++++++++
 lustre/ptlrpc/import.c | 7 ++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index e9a30134da..d51c83dee2 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -771,6 +771,14 @@ read
 	     status of conflictness, since we are guaranteed there are no
 	     conflicting locks in the rest of the list.
 
+Severity   : normal
+Bugzilla   : 14774
+Description: Time out and refuse to reconnect
+Details    : When the failover node is the primary node, it is possible
+	     to have two identical connections in imp_conn_list. We must
+	     compare not conn's pointers but NIDs, otherwise we can defeat
+	     connection throttling.
+
 --------------------------------------------------------------------------------
 
 2007-08-10         Cluster File Systems, Inc. <info@clusterfs.com>
diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c
index 5082bc5b60..1dfd0a578b 100644
--- a/lustre/ptlrpc/import.c
+++ b/lustre/ptlrpc/import.c
@@ -536,7 +536,12 @@ static void ptlrpc_maybe_ping_import_soon(struct obd_import *imp)
                               struct obd_import_conn,
                               oic_item);
 
-        if (imp->imp_conn_current != imp_conn) {
+        /* XXX: When the failover node is the primary node, it is possible
+         * to have two identical connections in imp_conn_list. We must 
+         * compare not conn's pointers but NIDs, otherwise we can defeat
+         * connection throttling. (See bug 14774.) */
+        if (imp->imp_conn_current->oic_conn->c_self != 
+                                imp_conn->oic_conn->c_self) {
                 ptlrpc_ping_import_soon(imp);
                 wake_pinger = 1;
         }
-- 
GitLab