Whamcloud - gitweb
LU-2528 misc: quiet warning for 2.1/2.5 connections 16/7916/2
authorAndreas Dilger <andreas.dilger@intel.com>
Thu, 10 Oct 2013 18:32:34 +0000 (12:32 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 6 Nov 2013 06:57:41 +0000 (06:57 +0000)
The Lustre 2.5.4 client will print a warning about connections with
2.1.3 servers, yet they are still supposed to be interoperable.
Increase the window of warning to be up to Lustre 2.5.50, since we
do not intend to allow interoperability between 2.1 and 2.6 systems.
This was from the time when major releases like Lustre 1.4 and 1.8
were many years apart would have no chance for interoperation.

Only print this message once per client, to avoid flooding the console
for connections to many servers or frequent network reconnections.
Server versions should all be nearly the same in any case.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I503523f80144c00c5ea1d312cc9204d9123ebbe5
Reviewed-on: http://review.whamcloud.com/7916
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/autoconf/lustre-version.ac
lustre/ptlrpc/import.c

index 8dda0ad..0d71979 100644 (file)
@@ -9,7 +9,7 @@ m4_define([LUSTRE_VER_ALLOWED_OFFSET],["OBD_OCD_VERSION(0, 0, 1, 32)"])
 m4_define([LUSTRE_LIB_VER_OFFSET_WARN],["OBD_OCD_VERSION(0, 0, 1, 32)"])
 
 dnl # linux lustre delta is 0.4.0.0 , next stable release version is ok
 m4_define([LUSTRE_LIB_VER_OFFSET_WARN],["OBD_OCD_VERSION(0, 0, 1, 32)"])
 
 dnl # linux lustre delta is 0.4.0.0 , next stable release version is ok
-m4_define([LUSTRE_CLI_VER_OFFSET_WARN],["OBD_OCD_VERSION(0, 4, 0, 0)"])
+m4_define([LUSTRE_CLI_VER_OFFSET_WARN],["OBD_OCD_VERSION(0, 4, 50, 0)"])
 
 dnl # User editable part ends here. -----------------------------------------
 
 
 dnl # User editable part ends here. -----------------------------------------
 
index db2c547..495721a 100644 (file)
@@ -1008,6 +1008,7 @@ finish:
                        RETURN(0);
                }
        } else {
                        RETURN(0);
                }
        } else {
+               static bool warned;
 
                spin_lock(&imp->imp_lock);
                cfs_list_del(&imp->imp_conn_current->oic_item);
 
                spin_lock(&imp->imp_lock);
                cfs_list_del(&imp->imp_conn_current->oic_item);
@@ -1018,38 +1019,39 @@ finish:
 
                spin_unlock(&imp->imp_lock);
 
 
                spin_unlock(&imp->imp_lock);
 
-                if (!ocd->ocd_ibits_known &&
-                    ocd->ocd_connect_flags & OBD_CONNECT_IBITS)
-                        CERROR("Inodebits aware server returned zero compatible"
-                               " bits?\n");
-
-                if ((ocd->ocd_connect_flags & OBD_CONNECT_VERSION) &&
-                    (ocd->ocd_version > LUSTRE_VERSION_CODE +
-                                        LUSTRE_VERSION_OFFSET_WARN ||
-                     ocd->ocd_version < LUSTRE_VERSION_CODE -
-                                        LUSTRE_VERSION_OFFSET_WARN)) {
-                        /* Sigh, some compilers do not like #ifdef in the middle
-                           of macro arguments */
+               if (!ocd->ocd_ibits_known &&
+                   ocd->ocd_connect_flags & OBD_CONNECT_IBITS)
+                       CERROR("Inodebits aware server returned zero compatible"
+                              " bits?\n");
+
+               if (!warned && (ocd->ocd_connect_flags & OBD_CONNECT_VERSION) &&
+                   (ocd->ocd_version > LUSTRE_VERSION_CODE +
+                                       LUSTRE_VERSION_OFFSET_WARN ||
+                    ocd->ocd_version < LUSTRE_VERSION_CODE -
+                                       LUSTRE_VERSION_OFFSET_WARN)) {
+                       /* Sigh, some compilers do not like #ifdef in the middle
+                          of macro arguments */
+                       const char *older = "older than client. "
+                                           "Consider upgrading server";
 #ifdef __KERNEL__
 #ifdef __KERNEL__
-                        const char *older = "older. Consider upgrading server "
-                                            "or downgrading client";
+                       const char *newer = "newer than client. "
+                                           "Consider recompiling application";
 #else
 #else
-                        const char *older = "older. Consider recompiling this "
-                                            "application";
+                       const char *newer = "newer than client. "
+                                           "Consider upgrading client";
 #endif
 #endif
-                        const char *newer = "newer than client version. "
-                                            "Consider upgrading client";
 
 
-                        LCONSOLE_WARN("Server %s version (%d.%d.%d.%d) "
-                                      "is much %s (%s)\n",
-                                      obd2cli_tgt(imp->imp_obd),
-                                      OBD_OCD_VERSION_MAJOR(ocd->ocd_version),
-                                      OBD_OCD_VERSION_MINOR(ocd->ocd_version),
-                                      OBD_OCD_VERSION_PATCH(ocd->ocd_version),
-                                      OBD_OCD_VERSION_FIX(ocd->ocd_version),
-                                      ocd->ocd_version > LUSTRE_VERSION_CODE ?
-                                      newer : older, LUSTRE_VERSION_STRING);
-                }
+                       LCONSOLE_WARN("Server %s version (%d.%d.%d.%d) "
+                                     "is much %s (%s)\n",
+                                     obd2cli_tgt(imp->imp_obd),
+                                     OBD_OCD_VERSION_MAJOR(ocd->ocd_version),
+                                     OBD_OCD_VERSION_MINOR(ocd->ocd_version),
+                                     OBD_OCD_VERSION_PATCH(ocd->ocd_version),
+                                     OBD_OCD_VERSION_FIX(ocd->ocd_version),
+                                     ocd->ocd_version > LUSTRE_VERSION_CODE ?
+                                     newer : older, LUSTRE_VERSION_STRING);
+                       warned = true;
+               }
 
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 2, 50, 0)
                /* Check if server has LU-1252 fix applied to not always swab
 
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 2, 50, 0)
                /* Check if server has LU-1252 fix applied to not always swab