Whamcloud - gitweb
Fixed lock_mode thinko
authorpschwan <pschwan>
Sun, 23 Jun 2002 20:15:26 +0000 (20:15 +0000)
committerpschwan <pschwan>
Sun, 23 Jun 2002 20:15:26 +0000 (20:15 +0000)
lustre/ldlm/ldlm_lockd.c
lustre/mdc/mdc_request.c

index 0c5ba82..e372327 100644 (file)
@@ -247,8 +247,8 @@ static int _ldlm_callback(struct ptlrpc_service *svc,
                                 lock->l_blocking_ast(lock, new, lock->l_data,
                                                      lock->l_data_len, NULL);
                 } else {
-                        CDEBUG(D_INFO, "Lock still has references; lock will be"
-                               " cancelled later.\n");
+                        LDLM_DEBUG(lock, "Lock still has references, will be"
+                               " cancelled later");
                 }
         }
 
index 691a237..2273bad 100644 (file)
@@ -335,12 +335,9 @@ int mdc_enqueue(struct obd_conn *conn, int lock_type, struct lookup_intent *it,
                               obddev->obd_namespace, NULL, res_id, lock_type,
                               NULL, 0, lock_mode, &flags,
                               (void *)mdc_lock_callback, data, datalen, lockh);
-        if (rc == -ENOENT) {
+        if (rc == -ENOENT || rc == ELDLM_LOCK_ABORTED) {
                 lock_mode = 0;
                 memset(lockh, 0, sizeof(*lockh));
-                it->it_lock_mode = lock_mode;
-        } else if (rc == ELDLM_LOCK_ABORTED) {
-                it->it_lock_mode = 0;
         } else if (rc != 0) {
                 CERROR("ldlm_cli_enqueue: %d\n", rc);
                 RETURN(rc);
@@ -349,6 +346,7 @@ int mdc_enqueue(struct obd_conn *conn, int lock_type, struct lookup_intent *it,
         dlm_rep = lustre_msg_buf(req->rq_repmsg, 0); 
         it->it_disposition = (int) dlm_rep->lock_policy_res1;
         it->it_status = (int) dlm_rep->lock_policy_res2;
+        it->it_lock_mode = lock_mode;
         it->it_data = req;
 
         RETURN(0);