From: vitaly Date: Fri, 10 Apr 2009 19:40:39 +0000 (+0000) Subject: Branch HEAD X-Git-Tag: v1_9_167~5 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=7dc8ef3fb64d5608d6dd1ce1cd4131a72b8c6666 Branch HEAD b=18792 i=jay i=huanghua 1. remove the assert for inode reference in cl_inode_fini(). 2. as ldlm_cli_cancel() takes a "long" lock, i.e. without a reference, we should not drop this reference later. --enable-lu_ref fix. --- diff --git a/lustre/include/lclient.h b/lustre/include/lclient.h index 6d60864..c0c6cd0 100644 --- a/lustre/include/lclient.h +++ b/lustre/include/lclient.h @@ -305,6 +305,8 @@ void ccc_transient_page_discard(const struct lu_env *env, int ccc_transient_page_prep(const struct lu_env *env, const struct cl_page_slice *slice, struct cl_io *io); +void ccc_lock_delete(const struct lu_env *env, + const struct cl_lock_slice *slice); void ccc_lock_fini(const struct lu_env *env,struct cl_lock_slice *slice); int ccc_lock_enqueue(const struct lu_env *env,const struct cl_lock_slice *slice, struct cl_io *io, __u32 enqflags); diff --git a/lustre/lclient/lcommon_cl.c b/lustre/lclient/lcommon_cl.c index b161c11c..569f165 100644 --- a/lustre/lclient/lcommon_cl.c +++ b/lustre/lclient/lcommon_cl.c @@ -560,11 +560,15 @@ int ccc_transient_page_prep(const struct lu_env *env, * */ +void ccc_lock_delete(const struct lu_env *env, + const struct cl_lock_slice *slice) +{ + CLOBINVRNT(env, slice->cls_obj, ccc_object_invariant(slice->cls_obj)); +} + void ccc_lock_fini(const struct lu_env *env, struct cl_lock_slice *slice) { struct ccc_lock *clk = cl2ccc_lock(slice); - - CLOBINVRNT(env, slice->cls_obj, ccc_object_invariant(slice->cls_obj)); OBD_SLAB_FREE_PTR(clk, ccc_lock_kmem); } @@ -1171,7 +1175,6 @@ void cl_inode_fini(struct inode *inode) int emergency; if (clob != NULL) { - struct lu_object_header *head = clob->co_lu.lo_header; void *cookie; cookie = cl_env_reenter(); @@ -1190,8 +1193,6 @@ void cl_inode_fini(struct inode *inode) */ cl_object_kill(env, clob); lu_object_ref_del(&clob->co_lu, "inode", inode); - /* XXX temporary: this is racy */ - LASSERT(atomic_read(&head->loh_ref) == 1); cl_object_put(env, clob); lli->lli_clob = NULL; if (emergency) { diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index d120548..b6fb1d1 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -1244,7 +1244,7 @@ int ldlm_cli_cancel(struct lustre_handle *lockh) rc = ldlm_cli_cancel_local(lock); if (rc < 0 || rc == LDLM_FL_LOCAL_ONLY) { - LDLM_LOCK_PUT(lock); + LDLM_LOCK_RELEASE(lock); RETURN(rc < 0 ? rc : 0); } /* Even if the lock is marked as LDLM_FL_BL_AST, this is a LDLM_CANCEL diff --git a/lustre/liblustre/llite_cl.c b/lustre/liblustre/llite_cl.c index ebd5064..0a29220 100644 --- a/lustre/liblustre/llite_cl.c +++ b/lustre/liblustre/llite_cl.c @@ -414,6 +414,7 @@ static int slp_lock_enqueue(const struct lu_env *env, } static const struct cl_lock_operations slp_lock_ops = { + .clo_delete = ccc_lock_delete, .clo_fini = ccc_lock_fini, .clo_enqueue = slp_lock_enqueue, .clo_wait = ccc_lock_wait, diff --git a/lustre/llite/vvp_lock.c b/lustre/llite/vvp_lock.c index f0c487d..846934c 100644 --- a/lustre/llite/vvp_lock.c +++ b/lustre/llite/vvp_lock.c @@ -73,6 +73,7 @@ static unsigned long vvp_lock_weigh(const struct lu_env *env, } static const struct cl_lock_operations vvp_lock_ops = { + .clo_delete = ccc_lock_delete, .clo_fini = ccc_lock_fini, .clo_enqueue = ccc_lock_enqueue, .clo_wait = ccc_lock_wait, diff --git a/lustre/osc/osc_lock.c b/lustre/osc/osc_lock.c index 742c399..c3b2fee 100644 --- a/lustre/osc/osc_lock.c +++ b/lustre/osc/osc_lock.c @@ -210,8 +210,7 @@ static void osc_lock_fini(const struct lu_env *env, */ if (ols->ols_hold) osc_lock_unuse(env, slice); - if (ols->ols_lock != NULL) - osc_lock_detach(env, ols); + LASSERT(ols->ols_lock == NULL); OBD_SLAB_FREE_PTR(ols, osc_lock_kmem); }