From 50a6dbb2ec0e7686d0321a80c97869ba5a737eda Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Fri, 20 Dec 2013 12:09:33 +0900 Subject: [PATCH] Revert "LU-3433 clio: wrong cl_lock usage" This seems to cause 3889 This reverts commit 1a04ba1a772659cc35f806210551ebf542c6365e. --- lustre/osc/osc_lock.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/lustre/osc/osc_lock.c b/lustre/osc/osc_lock.c index 37c3a40..1b44712 100644 --- a/lustre/osc/osc_lock.c +++ b/lustre/osc/osc_lock.c @@ -553,20 +553,17 @@ static int osc_lock_upcall(void *cookie, int errcode) lock->cll_flags |= CLF_FROM_UPCALL; cl_wait_try(env, lock); lock->cll_flags &= ~CLF_FROM_UPCALL; + if (!olck->ols_glimpse) + olck->ols_agl = 0; } cl_lock_signal(env, lock); - /* del user for lock upcall cookie */ - if (olck->ols_agl) { - if (!olck->ols_glimpse) - olck->ols_agl = 0; - cl_unuse_try(env, lock); - } - } else { - /* del user for lock upcall cookie */ - if (olck->ols_agl) - cl_lock_user_del(env, lock); - cl_lock_error(env, lock, rc); - } + /* del user for lock upcall cookie */ + cl_unuse_try(env, lock); + } else { + /* del user for lock upcall cookie */ + cl_lock_user_del(env, lock); + cl_lock_error(env, lock, rc); + } /* release cookie reference, acquired by osc_lock_enqueue() */ cl_lock_hold_release(env, lock, "upcall", lock); @@ -1182,9 +1179,8 @@ static int osc_lock_enqueue(const struct lu_env *env, /* lock will be passed as upcall cookie, * hold ref to prevent to be released. */ cl_lock_hold_add(env, lock, "upcall", lock); - /* a user for agl lock also */ - if (ols->ols_agl) - cl_lock_user_add(env, lock); + /* a user for lock also */ + cl_lock_user_add(env, lock); ols->ols_state = OLS_ENQUEUED; /* @@ -1202,8 +1198,7 @@ static int osc_lock_enqueue(const struct lu_env *env, ols, einfo, &ols->ols_handle, PTLRPCD_SET, 1, ols->ols_agl); if (result != 0) { - if (ols->ols_agl) - cl_lock_user_del(env, lock); + cl_lock_user_del(env, lock); cl_lock_unhold(env, lock, "upcall", lock); if (unlikely(result == -ECANCELED)) { ols->ols_state = OLS_NEW; -- 1.8.3.1