- LCONSOLE_WARN("%s: Client %s (at %s) refused connection, "
- "still busy with %d references\n",
- target->obd_name, cluuid.uuid,
- libcfs_nid2str(req->rq_peer.nid),
- atomic_read(&export->exp_refcount));
- GOTO(out, rc = -EBUSY);
- } else if (lustre_msg_get_conn_cnt(req->rq_reqmsg) == 1) {
- 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",
- target->obd_name, cluuid.uuid,
- libcfs_nid2str(req->rq_peer.nid));
- GOTO(out, rc = -EALREADY);
- } else {
- OBD_FAIL_TIMEOUT(OBD_FAIL_TGT_DELAY_RECONNECT, 2 * obd_timeout);
- }
-
- if (rc < 0) {
- GOTO(out, rc);
- }
-
- CDEBUG(D_HA, "%s: connection from %s@%s %st%llu exp %p cur %ld last %ld\n",
- target->obd_name, cluuid.uuid, libcfs_nid2str(req->rq_peer.nid),
- target->obd_recovering ? "recovering/" : "", data->ocd_transno,
- export, (long)cfs_time_current_sec(),
- export ? (long)export->exp_last_request_time : 0);
-
- /* If this is the first time a client connects, reset the recovery
- * timer. Discard lightweight connections which might be local. */
+ LCONSOLE_WARN("%s: Client %s (at %s) refused connection, still busy with %d references\n",
+ target->obd_name, cluuid.uuid,
+ libcfs_nid2str(req->rq_peer.nid),
+ refcount_read(&export->exp_handle.h_ref));
+ GOTO(out, rc = -EBUSY);
+ } 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",
+ target->obd_name, cluuid.uuid,
+ libcfs_nid2str(req->rq_peer.nid));
+ GOTO(out, rc = -EALREADY);
+ } else {
+ OBD_FAIL_TIMEOUT(OBD_FAIL_TGT_DELAY_RECONNECT, 2 * obd_timeout);
+ }
+
+ if (rc < 0)
+ GOTO(out, rc);
+
+ CDEBUG(D_HA, "%s: connection from %s@%s %st%llu exp %p cur %lld last %lld\n",
+ target->obd_name, cluuid.uuid, libcfs_nid2str(req->rq_peer.nid),
+ target->obd_recovering ? "recovering/" : "", data->ocd_transno,
+ export, ktime_get_seconds(),
+ export ? export->exp_last_request_time : 0);
+
+ /*
+ * If this is the first time a client connects, reset the recovery
+ * timer. Discard lightweight connections which might be local.
+ */