Whamcloud - gitweb
Updating b_narasimd branch.
authornarasimd <narasimd>
Wed, 11 Dec 2002 06:48:28 +0000 (06:48 +0000)
committernarasimd <narasimd>
Wed, 11 Dec 2002 06:48:28 +0000 (06:48 +0000)
lustre/lib/target.c

index 8786ee8..141e155 100644 (file)
@@ -69,7 +69,8 @@ int target_handle_connect(struct ptlrpc_request *req)
 
         rc = obd_connect(&conn, target, cluuid, ptlrpc_recovd,
                          target_revoke_connection);
-        if (rc)
+        /* EALREADY indicates a reconnection, send the reply normally. */
+        if (rc && rc != EALREADY)
                 GOTO(out, rc);
 
         rc = lustre_pack_msg(0, NULL, NULL, &req->rq_replen, &req->rq_repmsg);
@@ -99,8 +100,8 @@ int target_handle_connect(struct ptlrpc_request *req)
         dlmimp->imp_handle.addr = req->rq_reqmsg->addr;
         dlmimp->imp_handle.cookie = req->rq_reqmsg->cookie;
         dlmimp->imp_obd = /* LDLM! */ NULL;
-        
-        req->rq_connection->c_level = LUSTRE_CONN_FULL;
+        spin_lock_init(&dlmimp->imp_lock);
+        dlmimp->imp_level = LUSTRE_CONN_FULL;
 out:
         req->rq_status = rc;
         RETURN(rc);
@@ -147,7 +148,6 @@ static int target_fence_failed_connection(struct ptlrpc_connection *conn)
 {
         ENTRY;
 
-        conn->c_level = LUSTRE_CONN_RECOVD;
         conn->c_recovd_data.rd_phase = RD_PREPARED;
 
         RETURN(0);