From f1d98de9bd60b2d4a959b3f790f9e07e6547ff39 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Thu, 10 Oct 2013 12:32:34 -0600 Subject: [PATCH] LU-2528 misc: quiet warning for 2.1/2.5 connections 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 Change-Id: I503523f80144c00c5ea1d312cc9204d9123ebbe5 Reviewed-on: http://review.whamcloud.com/7916 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-version.ac | 2 +- lustre/ptlrpc/import.c | 58 ++++++++++++++++++++------------------- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/lustre/autoconf/lustre-version.ac b/lustre/autoconf/lustre-version.ac index 8dda0ad..0d71979 100644 --- a/lustre/autoconf/lustre-version.ac +++ b/lustre/autoconf/lustre-version.ac @@ -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_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. ----------------------------------------- diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index db2c547..495721a 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -1008,6 +1008,7 @@ finish: RETURN(0); } } else { + static bool warned; spin_lock(&imp->imp_lock); cfs_list_del(&imp->imp_conn_current->oic_item); @@ -1018,38 +1019,39 @@ finish: 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__ - const char *older = "older. Consider upgrading server " - "or downgrading client"; + const char *newer = "newer than client. " + "Consider recompiling application"; #else - const char *older = "older. Consider recompiling this " - "application"; + const char *newer = "newer than client. " + "Consider upgrading client"; #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 -- 1.8.3.1