From 3c131930207358edd9039ecf19d6bf40fb8e4678 Mon Sep 17 00:00:00 2001
From: bobijam <bobijam>
Date: Mon, 11 Aug 2008 05:45:20 +0000
Subject: [PATCH] Branch b1_6 b=16237 i=adilger, nathan

Description: Early reply size mismatch, MGC loses connection
Details    : Apply the MGS_CONNECT_SUPPORTED mask at reconnect time so
             the connect flags are properly negotiated.
---
 lustre/ChangeLog         |  6 +++++-
 lustre/mgs/mgs_handler.c | 21 +++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index fb8879f35d..4e8074d42c 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -38,7 +38,11 @@ tbd Sun Microsystems, Inc.
 	* Output of lfs quota has been made less detailed by default,
 	  old (verbose) output can be obtained by using -v option.
 
-
+Severity   : normal
+Bugzila    : 16237
+Description: Early reply size mismatch, MGC loses connection
+Details    : Apply the MGS_CONNECT_SUPPORTED mask at reconnect time so
+             the connect flags are properly negotiated.
 
 --------------------------------------------------------------------------
 
diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c
index 248574f063..21fee82d54 100644
--- a/lustre/mgs/mgs_handler.c
+++ b/lustre/mgs/mgs_handler.c
@@ -99,6 +99,26 @@ static int mgs_connect(struct lustre_handle *conn, struct obd_device *obd,
         RETURN(rc);
 }
 
+static int mgs_reconnect(struct obd_export *exp, struct obd_device *obd,
+                         struct obd_uuid *cluuid, struct obd_connect_data *data,
+                         void *localdata)
+{
+        ENTRY;
+
+        if (exp == NULL || obd == NULL || cluuid == NULL)
+                RETURN(-EINVAL);
+
+        mgs_counter_incr(exp, LPROC_MGS_CONNECT);
+
+        if (data != NULL) {
+                data->ocd_connect_flags &= MGS_CONNECT_SUPPORTED;
+                exp->exp_connect_flags = data->ocd_connect_flags;
+                data->ocd_version = LUSTRE_VERSION_CODE;
+        }
+
+        RETURN(0);
+}
+
 static int mgs_disconnect(struct obd_export *exp)
 {
         int rc;
@@ -741,6 +761,7 @@ out_free:
 static struct obd_ops mgs_obd_ops = {
         .o_owner           = THIS_MODULE,
         .o_connect         = mgs_connect,
+        .o_reconnect       = mgs_reconnect,
         .o_disconnect      = mgs_disconnect,
         .o_setup           = mgs_setup,
         .o_precleanup      = mgs_precleanup,
-- 
GitLab