"lost; in progress operations using this "
"service will wait for recovery to complete\n",
imp->imp_obd->obd_name, target_len, target_start,
- libcfs_nid2str(imp->imp_connection->c_peer.nid));
- } else {
- LCONSOLE_ERROR_MSG(0x166, "%s: Connection to "
- "%.*s (at %s) was lost; in progress "
- "operations using this service will fail\n",
- imp->imp_obd->obd_name,
- target_len, target_start,
- libcfs_nid2str(imp->imp_connection->c_peer.nid));
- }
- IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_DISCON);
+ obd_import_nid2str(imp));
+ } else {
+ LCONSOLE_ERROR_MSG(0x166, "%s: Connection to "
+ "%.*s (at %s) was lost; in progress "
+ "operations using this service will fail\n",
+ imp->imp_obd->obd_name, target_len, target_start,
+ obd_import_nid2str(imp));
+ }
+ IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_DISCON);
spin_unlock(&imp->imp_lock);
if (obd_dump_on_timeout)
}
list_for_each_entry(conn, &imp->imp_conn_list, oic_item) {
- CDEBUG(D_HA, "%s: connect to NID %s last attempt %llu\n",
+ CDEBUG(D_HA, "%s: connect to NID %s last attempt %lld\n",
imp->imp_obd->obd_name,
libcfs_nid2str(conn->oic_conn->c_peer.nid),
conn->oic_last_attempt);
/* If we have not tried this connection since
the last successful attempt, go with this one */
if ((conn->oic_last_attempt == 0) ||
- cfs_time_beforeq_64(conn->oic_last_attempt,
- imp->imp_last_success_conn)) {
+ conn->oic_last_attempt <= imp->imp_last_success_conn) {
imp_conn = conn;
tried_all = 0;
break;
least recently used */
if (!imp_conn)
imp_conn = conn;
- else if (cfs_time_before_64(conn->oic_last_attempt,
- imp_conn->oic_last_attempt))
+ else if (imp_conn->oic_last_attempt > conn->oic_last_attempt)
imp_conn = conn;
}
"to %ds\n", imp->imp_obd->obd_name, at_get(at));
}
- imp_conn->oic_last_attempt = cfs_time_current_64();
+ imp_conn->oic_last_attempt = ktime_get_seconds();
/* switch connection, don't mind if it's same as the current one */
if (imp->imp_connection)
warned = true;
}
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 0, 53, 0)
- /* Check if server has LU-1252 fix applied to not always swab
- * the IR MNE entries. Do this only once per connection. This
- * fixup is version-limited, because we don't want to carry the
- * OBD_CONNECT_MNE_SWAB flag around forever, just so long as we
- * need interop with unpatched 2.2 servers. For newer servers,
- * the client will do MNE swabbing only as needed. LU-1644 */
- if (unlikely((ocd->ocd_connect_flags & OBD_CONNECT_VERSION) &&
- !(ocd->ocd_connect_flags & OBD_CONNECT_MNE_SWAB) &&
- OBD_OCD_VERSION_MAJOR(ocd->ocd_version) == 2 &&
- OBD_OCD_VERSION_MINOR(ocd->ocd_version) == 2 &&
- OBD_OCD_VERSION_PATCH(ocd->ocd_version) < 55 &&
- strcmp(imp->imp_obd->obd_type->typ_name,
- LUSTRE_MGC_NAME) == 0))
- imp->imp_need_mne_swab = 1;
- else /* clear if server was upgraded since last connect */
- imp->imp_need_mne_swab = 0;
-#endif
-
if (ocd->ocd_connect_flags & OBD_CONNECT_CKSUM) {
/* We sent to the server ocd_cksum_types with bits set
* for algorithms we understand. The server masked off
__u64 old_connect_flags;
int msg_flags;
struct obd_connect_data *ocd;
- struct obd_export *exp;
+ struct obd_export *exp = NULL;
int ret;
ENTRY;
rc = ptlrpc_connect_set_flags(imp, ocd, old_connect_flags, exp,
aa->pcaa_initial_connect);
class_export_put(exp);
+ exp = NULL;
+
if (rc != 0)
GOTO(out, rc);
imp->imp_connect_tried = 1;
spin_unlock(&imp->imp_lock);
+ if (exp != NULL)
+ class_export_put(exp);
+
if (rc != 0) {
IMPORT_SET_STATE(imp, LUSTRE_IMP_DISCON);
if (rc == -EACCES) {
LCONSOLE_INFO("%s: Connection restored to %s (at %s)\n",
imp->imp_obd->obd_name,
obd_uuid2str(&conn->c_remote_uuid),
- libcfs_nid2str(imp->imp_connection->c_peer.nid));
+ obd_import_nid2str(imp));
}
if (imp->imp_state == LUSTRE_IMP_FULL) {