int client_connect_import(struct lustre_handle *dlm_handle,
struct obd_device *obd,
- struct obd_uuid *cluuid)
+ struct obd_uuid *cluuid,
+ unsigned long connect_flags)
{
struct client_obd *cli = &obd->u.cli;
struct obd_import *imp = cli->cl_import;
GOTO(out_ldlm, rc);
exp->exp_connection = ptlrpc_connection_addref(imp->imp_connection);
+ imp->imp_connect_flags = connect_flags;
rc = ptlrpc_connect_import(imp, NULL);
if (rc != 0) {
LASSERT (imp->imp_state == LUSTRE_IMP_DISCON);
int target_handle_connect(struct ptlrpc_request *req)
{
+ unsigned long connect_flags = 0, *cfp;
struct obd_device *target;
struct obd_export *export = NULL;
struct obd_import *revimp;
memcpy(&conn, tmp, sizeof conn);
+ cfp = lustre_msg_buf(req->rq_reqmsg, 3, sizeof(unsigned long));
+ LASSERT(cfp != NULL);
+ connect_flags = *cfp;
+
rc = lustre_pack_reply(req, 0, NULL, NULL);
if (rc)
GOTO(out, rc);
/* Tell the client if we're in recovery. */
/* If this is the first client, start the recovery timer */
- CWARN("%s: connection from %s@%s %s\n", target->obd_name, cluuid.uuid,
- ptlrpc_peernid2str(&req->rq_peer, peer_str),
+ CWARN("%s: connection from %s@%s/%lu %s\n", target->obd_name, cluuid.uuid,
+ ptlrpc_peernid2str(&req->rq_peer, peer_str), *cfp,
target->obd_recovering ? "(recovering)" : "");
if (target->obd_recovering) {
lustre_msg_add_op_flags(req->rq_repmsg, MSG_CONNECT_RECOVERING);
rc = -EBUSY;
} else {
dont_check_exports:
- rc = obd_connect(&conn, target, &cluuid);
+ rc = obd_connect(&conn, target, &cluuid, connect_flags);
}
}
/* Tell the client if we support replayable requests */
revimp->imp_dlm_fake = 1;
revimp->imp_state = LUSTRE_IMP_FULL;
class_import_put(revimp);
+
+ rc = obd_connect_post(export);
out:
if (rc)
req->rq_status = rc;
static int check_for_next_transno(struct obd_device *obd)
{
- struct ptlrpc_request *req;
+ struct ptlrpc_request *req = NULL;
int wake_up = 0, connected, completed, queue_len, max;
__u64 next_transno, req_transno;
LASSERT(trd->trd_processing_task == current->pid);
req = target_next_replay_req(obd);
if (req != NULL) {
- DEBUG_REQ(D_HA, req, "processing t"LPD64" : ",
- req->rq_reqmsg->transno);
+ char peer_str[PTL_NALFMT_SIZE];
+ DEBUG_REQ(D_HA, req, "processing t"LPD64" from %s: ",
+ req->rq_reqmsg->transno,
+ ptlrpc_peernid2str(&req->rq_peer, peer_str));
(void)trd->trd_recovery_handler(req);
obd->obd_replayed_requests++;
reset_recovery_timer(obd);