Whamcloud - gitweb
b=22244 handle list of locks in ldlm_bl_thread_main properly
authorVitaly Fertman <Vitaly.Fertman@sun.com>
Thu, 24 Jun 2010 20:31:36 +0000 (00:31 +0400)
committerRobert Read <robert.read@oracle.com>
Fri, 25 Jun 2010 17:30:05 +0000 (10:30 -0700)
the fix to the original patch includes:
1. ldlm_bl_thread_main() cancels only locks left in the list after
ldlm_cli_cancel_list_local().
2. ldlm_bl_thread_main() and ldlm_cli_cancel_unused_resource() cancel
locks marked as LDLM_FL_BL_AST in the same RPC as others in the list.

i=green
i=johann

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

index 8358d58..ac83fa8 100644 (file)
@@ -2222,14 +2222,15 @@ static int ldlm_bl_thread_main(void *arg)
                 }
 
                 if (blwi->blwi_count) {
                 }
 
                 if (blwi->blwi_count) {
+                        int count;
                         /* The special case when we cancel locks in lru
                          * asynchronously, we pass the list of locks here.
                          * Thus locks are marked LDLM_FL_CANCELING, but NOT
                          * canceled locally yet. */
                         /* The special case when we cancel locks in lru
                          * asynchronously, we pass the list of locks here.
                          * Thus locks are marked LDLM_FL_CANCELING, but NOT
                          * canceled locally yet. */
-                        ldlm_cli_cancel_list_local(&blwi->blwi_head,
-                                                   blwi->blwi_count, 0);
-                        ldlm_cli_cancel_list(&blwi->blwi_head,
-                                             blwi->blwi_count, NULL, 0);
+                        count = ldlm_cli_cancel_list_local(&blwi->blwi_head,
+                                                           blwi->blwi_count,
+                                                           LCF_BL_AST);
+                        ldlm_cli_cancel_list(&blwi->blwi_head, count, NULL, 0);
                 } else {
                         ldlm_handle_bl_callback(blwi->blwi_ns, &blwi->blwi_ld,
                                                 blwi->blwi_lock);
                 } else {
                         ldlm_handle_bl_callback(blwi->blwi_ns, &blwi->blwi_ld,
                                                 blwi->blwi_lock);
index 4c7f180..13e3a6d 100644 (file)
@@ -1751,7 +1751,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
 
         LDLM_RESOURCE_ADDREF(res);
         count = ldlm_cancel_resource_local(res, &cancels, policy, mode,
 
         LDLM_RESOURCE_ADDREF(res);
         count = ldlm_cancel_resource_local(res, &cancels, policy, mode,
-                                           0, flags, opaque);
+                                           0, flags | LCF_BL_AST, opaque);
         rc = ldlm_cli_cancel_list(&cancels, count, NULL, flags);
         if (rc != ELDLM_OK)
                 CERROR("ldlm_cli_cancel_unused_resource: %d\n", rc);
         rc = ldlm_cli_cancel_list(&cancels, count, NULL, flags);
         if (rc != ELDLM_OK)
                 CERROR("ldlm_cli_cancel_unused_resource: %d\n", rc);