*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*/
/**
list_for_each_entry(conn, &imp->imp_conn_list, oic_item) {
if (class_check_uuid(&conn->oic_uuid, nids[0])) {
*uuid = conn->oic_uuid;
+ spin_unlock(&imp->imp_lock);
rc = class_add_nids_to_uuid(&conn->oic_uuid, nids,
nid_count);
- break;
+ RETURN(rc);
}
}
spin_unlock(&imp->imp_lock);
if (lustre_cfg_buf(lcfg, 4)) {
__u32 refnet = libcfs_str2net(lustre_cfg_string(lcfg, 4));
- if (refnet == LNET_NIDNET(LNET_NID_ANY)) {
+ if (refnet == LNET_NET_ANY) {
rc = -EINVAL;
CERROR("%s: bad mount option 'network=%s': rc = %d\n",
obd->obd_name, lustre_cfg_string(lcfg, 4),
LDLM_NAMESPACE_CLIENT,
LDLM_NAMESPACE_GREEDY,
ns_type);
- if (obd->obd_namespace == NULL) {
- CERROR("Unable to create client namespace - %s\n",
- obd->obd_name);
- GOTO(err_import, rc = -ENOMEM);
+ if (IS_ERR(obd->obd_namespace)) {
+ rc = PTR_ERR(obd->obd_namespace);
+ CERROR("%s: unable to create client namespace: rc = %d\n",
+ obd->obd_name, rc);
+ obd->obd_namespace = NULL;
+ GOTO(err_import, rc);
}
RETURN(rc);
OBD_FREE(cli->cl_mod_tag_bitmap,
BITS_TO_LONGS(OBD_MAX_RIF_MAX) * sizeof(long));
cli->cl_mod_tag_bitmap = NULL;
- RETURN(rc);
+ RETURN(rc);
}
EXPORT_SYMBOL(client_obd_setup);
revimp->imp_msghdr_flags |= MSGHDR_CKSUM_INCOMPAT18;
+ revimp->imp_connect_data = *data;
rc = sptlrpc_import_sec_adapt(revimp, req->rq_svc_ctx, &req->rq_flvr);
if (rc) {
CERROR("%s: cannot get reverse import %s security: rc = %d\n",
struct obd_connect_data *data, *tmpdata;
int size, tmpsize;
lnet_nid_t *client_nid = NULL;
+ struct ptlrpc_connection *pcon = NULL;
ENTRY;
* processing, so we needs to allow lw_client to be connected at
* anytime, instead of only the initial connection
*/
- lw_client = (data->ocd_connect_flags & OBD_CONNECT_LIGHTWEIGHT) != 0;
+ lw_client = OCD_HAS_FLAG(data, LIGHTWEIGHT);
if (lustre_msg_get_op_flags(req->rq_reqmsg) & MSG_CONNECT_INITIAL) {
initial_conn = true;
- mds_conn = (data->ocd_connect_flags & OBD_CONNECT_MDS) != 0;
- mds_mds_conn = (data->ocd_connect_flags &
- OBD_CONNECT_MDS_MDS) != 0;
+ mds_conn = OCD_HAS_FLAG(data, MDS);
+ mds_mds_conn = OCD_HAS_FLAG(data, MDS_MDS);
/*
* OBD_CONNECT_MNE_SWAB is removed at 2.14
export = NULL;
rc = -EALREADY;
} else if ((mds_conn || (lw_client && initial_conn) ||
- data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) &&
- export->exp_connection != NULL) {
+ OCD_HAS_FLAG(data, MDS_MDS)) && export->exp_connection) {
spin_unlock(&export->exp_lock);
if (req->rq_peer.nid != export->exp_connection->c_peer.nid) {
/* MDS or LWP reconnected after failover. */
LCONSOLE_WARN("%s: Received %s connection from %s, removing former export from %s\n",
target->obd_name,
- mds_conn ? "MDS" : "LWP",
+ lw_client ? "LWP" : "MDS",
libcfs_nid2str(req->rq_peer.nid),
libcfs_nid2str(export->exp_connection->c_peer.nid));
} else {
- /* New MDS connection from the same NID. */
- LCONSOLE_WARN("%s: Received new %s connection from %s, removing former export from same NID\n",
+ /* New connection from the same NID. */
+ LCONSOLE_WARN("%s: Received new %s connection from %s, %s former export from same NID\n",
target->obd_name,
- mds_conn ? "MDS" : "LWP",
- libcfs_nid2str(req->rq_peer.nid));
+ lw_client ? "LWP" : "MDS",
+ libcfs_nid2str(req->rq_peer.nid),
+ OCD_HAS_FLAG(data, MDS_MDS) ?
+ "keep" : "remove");
}
if (req->rq_peer.nid == export->exp_connection->c_peer.nid &&
- data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) {
+ OCD_HAS_FLAG(data, MDS_MDS)) {
/*
* Because exports between MDTs will always be
* kept, let's do not fail such export if they
} else if (lustre_msg_get_conn_cnt(req->rq_reqmsg) == 1 &&
rc != EALREADY) {
if (!strstr(cluuid.uuid, "mdt"))
- LCONSOLE_WARN("%s: Rejecting reconnect from the known client %s (at %s) because it is indicating it is a new client",
+ LCONSOLE_WARN("%s: Rejecting reconnect from the known client %s (at %s) because it is indicating it is a new client\n",
target->obd_name, cluuid.uuid,
libcfs_nid2str(req->rq_peer.nid));
GOTO(out, rc = -EALREADY);
*/
ptlrpc_request_change_export(req, export);
+ pcon = ptlrpc_connection_get(req->rq_peer, req->rq_self, &cluuid);
+ if (pcon == NULL)
+ GOTO(out, rc = -ENOTCONN);
+
spin_lock(&export->exp_lock);
+
+ if (export->exp_disconnected) {
+ spin_unlock(&export->exp_lock);
+ GOTO(out, rc = -ENODEV);
+ }
if (export->exp_conn_cnt >= lustre_msg_get_conn_cnt(req->rq_reqmsg)) {
spin_unlock(&export->exp_lock);
CDEBUG(D_RPCTRACE,
}
LASSERT(lustre_msg_get_conn_cnt(req->rq_reqmsg) > 0);
export->exp_conn_cnt = lustre_msg_get_conn_cnt(req->rq_reqmsg);
- spin_unlock(&export->exp_lock);
-
- if (export->exp_connection != NULL) {
- /* Check to see if connection came from another NID. */
- if (export->exp_connection->c_peer.nid != req->rq_peer.nid)
- obd_nid_del(export->exp_obd, export);
+ /* Check to see if connection came from another NID. */
+ if (export->exp_connection != NULL &&
+ export->exp_connection->c_peer.nid != req->rq_peer.nid) {
+ obd_nid_del(export->exp_obd, export);
ptlrpc_connection_put(export->exp_connection);
+ export->exp_connection = NULL;
}
- export->exp_connection = ptlrpc_connection_get(req->rq_peer,
- req->rq_self,
- &cluuid);
- if (!export->exp_connection)
- GOTO(out, rc = -ENOTCONN);
-
+ if (export->exp_connection == NULL) {
+ export->exp_connection = pcon;
+ pcon = NULL;
+ }
obd_nid_add(export->exp_obd, export);
+ spin_unlock(&export->exp_lock);
+
lustre_msg_set_handle(req->rq_repmsg, &conn);
rc = rev_import_reconnect(export, req);
spin_unlock(&target->obd_dev_lock);
class_decref(target, "find", current);
}
+ if (pcon)
+ ptlrpc_connection_put(pcon);
req->rq_status = rc;
RETURN(rc);
}
atomic_read(&obd->obd_connected_clients),
obd->obd_stale_clients,
obd->obd_stale_clients == 1 ? "was" : "were");
+ if (obd->obd_stale_clients && do_dump_on_eviction(obd))
+ libcfs_debug_dumplog();
}
ldlm_reprocess_recovery_done(obd->obd_namespace);
return;
}
obd->obd_recovering = obd->obd_abort_recovery = 0;
+ obd->obd_abort_recov_mdt = 0;
spin_unlock(&obd->obd_dev_lock);
spin_lock(&obd->obd_recovery_task_lock);
thread->t_env = env;
thread->t_id = -1; /* force filter_iobuf_get/put to use local buffers */
+ thread->t_task = current;
env->le_ctx.lc_thread = thread;
tgt_io_thread_init(thread); /* init thread_big_cache for IO requests */
LASSERT(trd->trd_processing_task == current->pid);
DEBUG_REQ(D_HA, req, "processing lock from %s:",
libcfs_nid2str(req->rq_peer.nid));
+ if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_LOCK_REPLAY)) {
+ req->rq_status = -ENODEV;
+ target_request_copy_put(req);
+ continue;
+ }
handle_recovery_req(thread, req,
trd->trd_recovery_handler);
target_request_copy_put(req);
*/
spin_lock(&obd->obd_dev_lock);
obd->obd_recovering = obd->obd_abort_recovery = 0;
+ obd->obd_abort_recov_mdt = 0;
spin_unlock(&obd->obd_dev_lock);
spin_lock(&obd->obd_recovery_task_lock);
target_cancel_recovery_timer(obd);