fed->fed_group = data->ocd_group;
data->ocd_connect_flags &= OST_CONNECT_SUPPORTED;
- exp->exp_connect_data = *data;
data->ocd_version = LUSTRE_VERSION_CODE;
/* Kindly make sure the SKIP_ORPHAN flag is from MDS. */
data->ocd_grant_extent = ofd->ofd_dt_conf.ddp_grant_frag >> 10;
}
- if (exp_connect_flags(exp) & OBD_CONNECT_GRANT)
+ if (data->ocd_connect_flags & OBD_CONNECT_GRANT)
data->ocd_grant = ofd_grant_connect(env, exp, data->ocd_grant,
new_connection);
RETURN(rc);
}
-#define ost_init_sec_none(reply, exp) \
+#define ost_init_sec_none(reply) \
do { \
reply->ocd_connect_flags &= ~(OBD_CONNECT_RMT_CLIENT | \
OBD_CONNECT_RMT_CLIENT_FORCE | \
OBD_CONNECT_OSS_CAPA); \
- spin_lock(&exp->exp_lock); \
- *exp_connect_flags_ptr(exp) = reply->ocd_connect_flags; \
- spin_unlock(&exp->exp_lock); \
} while (0)
static int ost_init_sec_level(struct ptlrpc_request *req)
/* connection from MDT is always trusted */
if (req->rq_auth_usr_mdt) {
- ost_init_sec_none(reply, exp);
+ ost_init_sec_none(reply);
RETURN(0);
}
client, obd->obd_name, filter->fo_sec_level);
RETURN(-EACCES);
} else {
- ost_init_sec_none(reply, exp);
+ ost_init_sec_none(reply);
RETURN(0);
}
}
CWARN("client %s -> target %s uses old version, "
"run under security level %d.\n",
client, obd->obd_name, filter->fo_sec_level);
- ost_init_sec_none(reply, exp);
+ ost_init_sec_none(reply);
RETURN(0);
}
}
switch (filter->fo_sec_level) {
case LUSTRE_SEC_NONE:
if (!remote) {
- ost_init_sec_none(reply, exp);
+ ost_init_sec_none(reply);
break;
} else {
CDEBUG(D_SEC, "client %s -> target %s is set as remote, "
}
case LUSTRE_SEC_REMOTE:
if (!remote)
- ost_init_sec_none(reply, exp);
+ ost_init_sec_none(reply);
break;
case LUSTRE_SEC_ALL:
if (!remote) {
OBD_CONNECT_RMT_CLIENT_FORCE);
if (!filter->fo_fl_oss_capa)
reply->ocd_connect_flags &= ~OBD_CONNECT_OSS_CAPA;
-
- spin_lock(&exp->exp_lock);
- *exp_connect_flags_ptr(exp) = reply->ocd_connect_flags;
- spin_unlock(&exp->exp_lock);
}
break;
default:
if (!rc)
rc = ost_connect_check_sptlrpc(req);
}
+ if (rc == 0) {
+ struct obd_export *exp = req->rq_export;
+ struct obd_connect_data *reply;
+ /* Now that connection handling has completed
+ * successfully, atomically update the connect flags
+ * in the shared export data structure.*/
+ reply = req_capsule_server_get(&req->rq_pill,
+ &RMF_CONNECT_DATA);
+ spin_lock(&exp->exp_lock);
+ exp->exp_connect_data = *reply;
+ spin_unlock(&exp->exp_lock);
+ }
break;
}
case OST_DISCONNECT: