struct obd_uuid tgtuuid;
struct obd_uuid cluuid;
struct obd_uuid remote_uuid;
+ struct list_head *p;
char *str, *tmp;
int rc = 0, abort_recovery;
struct obd_connect_data *data;
goto dont_check_exports;
spin_lock(&target->obd_dev_lock);
- export = lustre_hash_get_object_by_key(target->obd_uuid_hash_body, &cluuid);
+ list_for_each(p, &target->obd_exports) {
+ export = list_entry(p, struct obd_export, exp_obd_chain);
+ if (obd_uuid_equals(&cluuid, &export->exp_client_uuid)) {
+ if (export->exp_connecting) { /* bug 9635, et. al. */
+ CWARN("%s: exp %p already connecting\n",
+ export->exp_obd->obd_name, export);
+ export = NULL;
+ rc = -EALREADY;
+ break;
+ }
- if (export != NULL && export->exp_connecting) { /* bug 9635, et. al. */
- CWARN("%s: exp %p already connecting\n",
- export->exp_obd->obd_name, export);
- class_export_put(export);
- export = NULL;
- rc = -EALREADY;
- } else if (export != NULL) {
- /* make darn sure this is coming from the same peer
- * if the UUIDs matched */
- if ((export->exp_connection != NULL) &&
- (strcmp(libcfs_nid2str(req->rq_peer.nid),
- libcfs_nid2str(export->exp_connection->c_peer.nid)))) {
- CWARN("%s: cookie %s seen on new NID %s when "
- "existing NID %s is already connected\n",
- target->obd_name, cluuid.uuid,
- libcfs_nid2str(req->rq_peer.nid),
- libcfs_nid2str(export->exp_connection->c_peer.nid));
- class_export_put(export);
- export = NULL;
- rc = -EALREADY;
- } else {
- export->exp_connecting = 1;
- class_export_put(export);
- spin_unlock(&target->obd_dev_lock);
- LASSERT(export->exp_obd == target);
- rc = target_handle_reconnect(&conn, export, &cluuid);
- }
- }
+ /* make darn sure this is coming from the same peer
+ * if the UUIDs matched */
+ if ((export->exp_connection != NULL) &&
+ (strcmp(libcfs_nid2str(req->rq_peer.nid),
+ libcfs_nid2str(export->exp_connection->c_peer.nid)))) {
+ CWARN("%s: cookie %s seen on new NID %s when "
+ "existing NID %s is already connected\n",
+ target->obd_name, cluuid.uuid,
+ libcfs_nid2str(req->rq_peer.nid),
+ libcfs_nid2str(export->exp_connection->c_peer.nid));
+ export = NULL;
+ rc = -EALREADY;
+ break;
+ }
+
+ export->exp_connecting = 1;
+ spin_unlock(&target->obd_dev_lock);
+ LASSERT(export->exp_obd == target);
+ rc = target_handle_reconnect(&conn, export, &cluuid);
+ break;
+ }
+ export = NULL;
+ }
/* If we found an export, we already unlocked. */
if (!export) {
spin_unlock(&target->obd_dev_lock);
req->rq_self,
&remote_uuid);
- spin_lock(&target->obd_dev_lock);
- lustre_hash_additem(export->exp_obd->obd_nid_hash_body,
- &export->exp_connection->c_peer.nid,
- &export->exp_nid_hash);
- spin_unlock(&target->obd_dev_lock);
-
if (lustre_msg_get_op_flags(req->rq_repmsg) & MSG_CONNECT_RECONNECT)
GOTO(out, rc = 0);