Whamcloud - gitweb
LU-8654 obd: access ocd_connect_flags2 only when present
[fs/lustre-release.git] / lustre / mgs / mgs_handler.c
index 1eacc1f..785e094 100644 (file)
@@ -1502,7 +1502,10 @@ static int mgs_obd_connect(const struct lu_env *env, struct obd_export **exp,
 
        if (data != NULL) {
                data->ocd_connect_flags &= MGS_CONNECT_SUPPORTED;
-               data->ocd_connect_flags2 &= MGS_CONNECT_SUPPORTED2;
+
+               if (data->ocd_connect_flags & OBD_CONNECT_FLAGS2)
+                       data->ocd_connect_flags2 &= MGS_CONNECT_SUPPORTED2;
+
                data->ocd_version = LUSTRE_VERSION_CODE;
                lexp->exp_connect_data = *data;
        }
@@ -1531,7 +1534,10 @@ static int mgs_obd_reconnect(const struct lu_env *env, struct obd_export *exp,
 
        if (data != NULL) {
                data->ocd_connect_flags &= MGS_CONNECT_SUPPORTED;
-               data->ocd_connect_flags2 &= MGS_CONNECT_SUPPORTED2;
+
+               if (data->ocd_connect_flags & OBD_CONNECT_FLAGS2)
+                       data->ocd_connect_flags2 &= MGS_CONNECT_SUPPORTED2;
+
                data->ocd_version = LUSTRE_VERSION_CODE;
                exp->exp_connect_data = *data;
        }