Whamcloud - gitweb
b=2328
authorphil <phil>
Thu, 4 Dec 2003 04:41:32 +0000 (04:41 +0000)
committerphil <phil>
Thu, 4 Dec 2003 04:41:32 +0000 (04:41 +0000)
r=shaver
- Make sure that all locks which have been marked as receiving a blocking AST
  are eventually added to the waiting list, to evict badly-behaving clients.
- If a service node times out waiting for a lock, dump the namespace
  to the log, no more than once every 5 minutes

lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_request.c

index 30a0b1f..9fcdfa8 100644 (file)
@@ -555,8 +555,11 @@ int ldlm_handle_enqueue(struct ptlrpc_request *req,
         /* We never send a blocking AST until the lock is granted, but
          * we can tell it right now */
         l_lock(&lock->l_resource->lr_namespace->ns_lock);
-        if (lock->l_flags & LDLM_FL_AST_SENT)
+        if (lock->l_flags & LDLM_FL_AST_SENT) {
                 dlm_rep->lock_flags |= LDLM_FL_AST_SENT;
+                if (lock->l_granted_mode == lock->l_req_mode)
+                        ldlm_add_waiting_lock(lock);
+        }
         l_unlock(&lock->l_resource->lr_namespace->ns_lock);
 
         EXIT;
index 7b6f50d..a7c8050 100644 (file)
@@ -42,6 +42,7 @@ struct lock_wait_data {
 
 int ldlm_expired_completion_wait(void *data)
 {
+        static unsigned long next_dump = 0;
         struct lock_wait_data *lwd = data;
         struct ldlm_lock *lock = lwd->lwd_lock;
         struct obd_import *imp;
@@ -59,6 +60,10 @@ int ldlm_expired_completion_wait(void *data)
         LDLM_ERROR(lock, "lock timed out, entering recovery for %s@%s",
                    imp->imp_target_uuid.uuid,
                    imp->imp_connection->c_remote_uuid.uuid);
+        if (time_after(jiffies, next_dump)) {
+                next_dump = jiffies + 300 * HZ;
+                ldlm_namespace_dump(lock->l_resource->lr_namespace);
+        }
 
         RETURN(0);
 }