Whamcloud - gitweb
b=11778
[fs/lustre-release.git] / lustre / ldlm / ldlm_lib.c
index cbb963d..3122ebb 100644 (file)
@@ -569,13 +569,21 @@ int target_handle_connect(struct ptlrpc_request *req, svc_handler_t handler)
         /* end COMPAT_146 */
 
         if (!target || target->obd_stopping || !target->obd_set_up) {
-                DEBUG_REQ(D_ERROR, req, "UUID '%s' is not available "
-                          " for connect (%s)", str,
-                          !target ? "no target" :
-                          (target->obd_stopping ? "stopping" : "not set up"));
+                LCONSOLE_ERROR("UUID '%s' is not available "
+                               " for connect (%s)", str,
+                               !target ? "no target" :
+                               (target->obd_stopping ? "stopping" :
+                                "not set up"));
                 GOTO(out, rc = -ENODEV);
         }
 
+        if (target->obd_no_conn) {
+                LCONSOLE_WARN("%s: temporarily refusing client connection "
+                              "from %s\n", target->obd_name, 
+                              libcfs_nid2str(req->rq_peer.nid));
+                GOTO(out, rc = -EAGAIN);
+        }
+
         /* Make sure the target isn't cleaned up while we're here. Yes, 
            there's still a race between the above check and our incref here. 
            Really, class_uuid2obd should take the ref. */