From 2077d017053e22c9b1834f345dc086f200a32c7a Mon Sep 17 00:00:00 2001 From: bobijam Date: Wed, 20 Aug 2008 02:04:40 +0000 Subject: [PATCH] Branch b1_8_gate b=15825 o=green i=shadow, bobijam Description: Kernel BUG tries to release flock Details : Lustre does not destroy flock lock before last reference goes away. So always drop flock locks when client is evicted and perform unlock regardless of successfulness of speaking to MDS. --- lustre/ldlm/ldlm_lock.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 8fa601f..85a7853 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -170,8 +170,8 @@ void ldlm_lock_put(struct ldlm_lock *lock) OBD_FREE(lock->l_lvb_data, lock->l_lvb_len); ldlm_interval_free(ldlm_interval_detach(lock)); - OBD_FREE_RCU_CB(lock, sizeof(*lock), &lock->l_handle, - ldlm_lock_free); + OBD_FREE_RCU_CB(lock, sizeof(*lock), &lock->l_handle, + ldlm_lock_free); } EXIT; @@ -554,7 +554,7 @@ void ldlm_add_ast_work_item(struct ldlm_lock *lock, struct ldlm_lock *new, check_res_locked(lock->l_resource); if (new) ldlm_add_bl_work_item(lock, new, work_list); - else + else ldlm_add_cp_work_item(lock, work_list); EXIT; } @@ -590,7 +590,7 @@ void ldlm_lock_addref_internal(struct ldlm_lock *lock, __u32 mode) /* only called in ldlm_flock_destroy and for local locks. * for LDLM_FLOCK type locks, l_blocking_ast is null, and - * ldlm_lock_remove_from_lru() does nothing, it is safe + * ldlm_lock_remove_from_lru() does nothing, it is safe * for ldlm_flock_destroy usage by dropping some code */ void ldlm_lock_decref_internal_nolock(struct ldlm_lock *lock, __u32 mode) { @@ -650,10 +650,10 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode) * reference, put it on the LRU. */ ldlm_lock_add_to_lru(lock); unlock_res_and_lock(lock); - /* Call ldlm_cancel_lru() only if EARLY_CANCEL and LRU RESIZE - * are not supported by the server, otherwise, it is done on + /* Call ldlm_cancel_lru() only if EARLY_CANCEL and LRU RESIZE + * are not supported by the server, otherwise, it is done on * enqueue. */ - if (!exp_connect_cancelset(lock->l_conn_export) && + if (!exp_connect_cancelset(lock->l_conn_export) && !ns_connect_lru_resize(ns)) ldlm_cancel_lru(ns, 0, LDLM_ASYNC, 0); } else { @@ -762,7 +762,7 @@ static void search_granted_lock(struct list_head *queue, /* jump to next policy group within the mode group */ tmp = policy_end->l_res_link.next; - lock = list_entry(tmp, struct ldlm_lock, + lock = list_entry(tmp, struct ldlm_lock, l_res_link); } /* loop over policy groups within the mode group */ @@ -788,7 +788,7 @@ static void search_granted_lock(struct list_head *queue, return; } -static void ldlm_granted_list_add_lock(struct ldlm_lock *lock, +static void ldlm_granted_list_add_lock(struct ldlm_lock *lock, struct sl_insert_point *prev) { struct ldlm_resource *res = lock->l_resource; @@ -1303,7 +1303,7 @@ int ldlm_reprocess_queue(struct ldlm_resource *res, struct list_head *queue, } /* Helper function for pair ldlm_run_{bl,cp}_ast_work(). - * + * * Send an existing rpc set specified by @arg->set and then * destroy it. Create new one if @do_create flag is set. */ static void @@ -1352,7 +1352,7 @@ int ldlm_run_bl_ast_work(struct list_head *rpc_list) LDLM_LOCK_PUT(lock->l_blocking_lock); lock->l_blocking_lock = NULL; - rc = lock->l_blocking_ast(lock, &d, (void *)&arg, + rc = lock->l_blocking_ast(lock, &d, (void *)&arg, LDLM_CB_BLOCKING); LDLM_LOCK_PUT(lock); ast_count++; @@ -1371,7 +1371,7 @@ int ldlm_run_bl_ast_work(struct list_head *rpc_list) else /* In case when number of ASTs is multiply of * PARALLEL_AST_LIMIT or @rpc_list was initially empty, - * @arg.set must be destroyed here, otherwise we get + * @arg.set must be destroyed here, otherwise we get * write memory leaking. */ ptlrpc_set_destroy(arg.set); @@ -1437,7 +1437,7 @@ int ldlm_run_cp_ast_work(struct list_head *rpc_list) else /* In case when number of ASTs is multiply of * PARALLEL_AST_LIMIT or @rpc_list was initially empty, - * @arg.set must be destroyed here, otherwise we get + * @arg.set must be destroyed here, otherwise we get * write memory leaking. */ ptlrpc_set_destroy(arg.set); @@ -1561,7 +1561,7 @@ void ldlm_lock_cancel(struct ldlm_lock *lock) /* Yes, second time, just in case it was added again while we were running with no res lock in ldlm_cancel_callback */ - ldlm_del_waiting_lock(lock); + ldlm_del_waiting_lock(lock); ldlm_resource_unlink_lock(lock); ldlm_lock_destroy_nolock(lock); @@ -1650,8 +1650,8 @@ struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode, old_mode = lock->l_req_mode; lock->l_req_mode = new_mode; if (res->lr_type == LDLM_PLAIN || res->lr_type == LDLM_IBITS) { - /* remember the lock position where the lock might be - * added back to the granted list later and also + /* remember the lock position where the lock might be + * added back to the granted list later and also * remember the join mode for skiplist fixing. */ prev.res_link = lock->l_res_link.prev; prev.mode_link = lock->l_sl_mode.prev; @@ -1660,7 +1660,7 @@ struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode, } else { ldlm_resource_unlink_lock(lock); if (res->lr_type == LDLM_EXTENT) { - /* FIXME: ugly code, I have to attach the lock to a + /* FIXME: ugly code, I have to attach the lock to a * interval node again since perhaps it will be granted * soon */ CFS_INIT_LIST_HEAD(&node->li_group); -- 1.8.3.1