From: green Date: Wed, 13 May 2009 20:31:54 +0000 (+0000) Subject: b=17614 X-Git-Tag: v1_9_190~31 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b17815fa0cd5f4eea0b0897354b67ced0b5712f5;p=fs%2Flustre-release.git b=17614 r=adilger,shadow. Do not put cancelled locks into replay list, hold references on locks in replay list. --- diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index b6fb1d1..94b53a4 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -1950,9 +1950,15 @@ static int ldlm_chain_lock_for_replay(struct ldlm_lock *lock, void *closure) /* we use l_pending_chain here, because it's unused on clients. */ LASSERTF(list_empty(&lock->l_pending_chain),"lock %p next %p prev %p\n", lock, &lock->l_pending_chain.next,&lock->l_pending_chain.prev); - /* bug 9573: don't replay locks left after eviction */ - if (!(lock->l_flags & LDLM_FL_FAILED)) + /* bug 9573: don't replay locks left after eviction, or + * bug 17614: locks being actively cancelled. Get a reference + * on a lock so that it does not disapear under us (e.g. due to cancel) + */ + if (!(lock->l_flags & (LDLM_FL_FAILED|LDLM_FL_CANCELING))) { list_add(&lock->l_pending_chain, list); + LDLM_LOCK_GET(lock); + } + return LDLM_ITER_CONTINUE; } @@ -2106,9 +2112,12 @@ int ldlm_replay_locks(struct obd_import *imp) list_for_each_entry_safe(lock, next, &list, l_pending_chain) { list_del_init(&lock->l_pending_chain); - if (rc) + if (rc) { + LDLM_LOCK_PUT(lock); continue; /* or try to do the rest? */ + } rc = replay_one_lock(imp, lock); + LDLM_LOCK_PUT(lock); } atomic_dec(&imp->imp_replay_inflight);