From f2360643cbb8136f97ec750547d12c30f88e0d4d Mon Sep 17 00:00:00 2001 From: Vitaly Fertman Date: Fri, 25 Jun 2010 00:31:36 +0400 Subject: [PATCH] b=22244 handle list of locks in ldlm_bl_thread_main properly 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 | 9 +++++---- lustre/ldlm/ldlm_request.c | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 8358d58..ac83fa8 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -2222,14 +2222,15 @@ static int ldlm_bl_thread_main(void *arg) } 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. */ - 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); diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 4c7f180..13e3a6d 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -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, - 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); -- 1.8.3.1