Before 2.7.50 clients will send a struct obd_connect_data_v1 rather
than a full struct obd_connect_data. So check for OBD_CONNECT_FLAGS2
before accessing the ocd_connect_flags2 member of struct
obd_connect_data.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Ic1c2b54be9b3cbaec9af894f204663c74fa41213
Reviewed-on: http://review.whamcloud.com/22837
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
* connect flags from the obd_connect_data::ocd_connect_flags field of the
* reply. \see mdt_connect().
*
* connect flags from the obd_connect_data::ocd_connect_flags field of the
* reply. \see mdt_connect().
*
+ * Before 2.7.50 clients will send a struct obd_connect_data_v1 rather than a
+ * full struct obd_connect_data. So care must be taken when accessing fields
+ * that are not present in struct obd_connect_data_v1. See LU-16.
+ *
* \param exp the obd_export associated with this client/target pair
* \param mdt the target device for the connection
* \param data stores data for this connect request
* \param exp the obd_export associated with this client/target pair
* \param mdt the target device for the connection
* \param data stores data for this connect request
LASSERT(data != NULL);
data->ocd_connect_flags &= MDT_CONNECT_SUPPORTED;
LASSERT(data != NULL);
data->ocd_connect_flags &= MDT_CONNECT_SUPPORTED;
- data->ocd_connect_flags2 &= MDT_CONNECT_SUPPORTED2;
+
+ if (data->ocd_connect_flags & OBD_CONNECT_FLAGS2)
+ data->ocd_connect_flags2 &= MDT_CONNECT_SUPPORTED2;
+
data->ocd_ibits_known &= MDS_INODELOCK_FULL;
if (!(data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) &&
data->ocd_ibits_known &= MDS_INODELOCK_FULL;
if (!(data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) &&
if (data != NULL) {
data->ocd_connect_flags &= MGS_CONNECT_SUPPORTED;
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;
}
data->ocd_version = LUSTRE_VERSION_CODE;
lexp->exp_connect_data = *data;
}
if (data != NULL) {
data->ocd_connect_flags &= MGS_CONNECT_SUPPORTED;
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;
}
data->ocd_version = LUSTRE_VERSION_CODE;
exp->exp_connect_data = *data;
}
int rc;
data->ocd_connect_flags &= ECHO_CONNECT_SUPPORTED;
int rc;
data->ocd_connect_flags &= ECHO_CONNECT_SUPPORTED;
- data->ocd_connect_flags2 &= ECHO_CONNECT_SUPPORTED2;
+
+ if (data->ocd_connect_flags & OBD_CONNECT_FLAGS2)
+ data->ocd_connect_flags2 &= ECHO_CONNECT_SUPPORTED2;
+
rc = class_connect(&conn, obd, cluuid);
if (rc) {
CERROR("can't connect %d\n", rc);
rc = class_connect(&conn, obd, cluuid);
if (rc) {
CERROR("can't connect %d\n", rc);
* connect flags from the obd_connect_data::ocd_connect_flags field of the
* reply. \see tgt_connect().
*
* connect flags from the obd_connect_data::ocd_connect_flags field of the
* reply. \see tgt_connect().
*
+ * Before 2.7.50 clients will send a struct obd_connect_data_v1 rather than a
+ * full struct obd_connect_data. So care must be taken when accessing fields
+ * that are not present in struct obd_connect_data_v1. See LU-16.
+ *
* \param[in] env execution environment
* \param[in] exp the obd_export associated with this
* client/target pair
* \param[in] env execution environment
* \param[in] exp the obd_export associated with this
* client/target pair
fed->fed_group = data->ocd_group;
data->ocd_connect_flags &= OST_CONNECT_SUPPORTED;
fed->fed_group = data->ocd_group;
data->ocd_connect_flags &= OST_CONNECT_SUPPORTED;
- data->ocd_connect_flags2 &= OST_CONNECT_SUPPORTED2;
+
+ if (data->ocd_connect_flags & OBD_CONNECT_FLAGS2)
+ data->ocd_connect_flags2 &= OST_CONNECT_SUPPORTED2;
+
data->ocd_version = LUSTRE_VERSION_CODE;
/* Kindly make sure the SKIP_ORPHAN flag is from MDS. */
data->ocd_version = LUSTRE_VERSION_CODE;
/* Kindly make sure the SKIP_ORPHAN flag is from MDS. */