(1) if client failed to identification, it should not reconnect endlessly.
(2) client should check the connection error and return the value correctly.
__u32 imp_connect_op;
struct obd_connect_data imp_connect_data;
__u64 imp_connect_flags_orig;
+ int imp_connect_error;
__u32 imp_msg_magic;
rc = ptlrpc_queue_wait(req);
- if (rc)
+ if (rc) {
+ /* check connection error first */
+ if (obd->u.cli.cl_import->imp_connect_error)
+ rc = obd->u.cli.cl_import->imp_connect_error;
+
GOTO(out, rc);
+ }
msfs = lustre_swab_repbuf(req, REPLY_REC_OFF, sizeof(*msfs),
lustre_swab_obd_statfs);
LASSERT(req->rq_export != NULL);
info->mti_mdt = mdt_dev(req->rq_export->exp_obd->obd_lu_dev);
rc = mdt_init_idmap(info);
+ if (rc != 0)
+ /* if mdt_init_idmap failed, revocation for connect */
+ obd_disconnect(class_export_get(req->rq_export));
} else
rc = err_serious(rc);
return rc;
if (req->rq_auth_uid == INVALID_UID) {
CERROR("client %s -> target %s null sec is used, "
"user not authenticated!\n", client, obd->obd_name);
- RETURN(-EPERM);
+ RETURN(-EACCES);
}
#endif
}
rc = ptlrpc_check_status(req);
+ imp->imp_connect_error = rc;
/* Either we've been evicted, or the server has failed for
* some reason. Try to reconnect, and if that fails, punt to the
if (aa->pcaa_initial_connect && !imp->imp_initial_recov)
ptlrpc_deactivate_import(imp);
- if (imp->imp_recon_bk && imp->imp_last_recon) {
- /* Give up trying to reconnect */
+ if ((imp->imp_recon_bk && imp->imp_last_recon) ||
+ (rc == -EACCES)) {
+ /*
+ * Give up trying to reconnect
+ * EACCES means client has no permission for connection
+ */
imp->imp_obd->obd_no_recov = 1;
ptlrpc_deactivate_import(imp);
}