Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-1299 clio: a combo patch to fix cl_lock
[fs/lustre-release.git]
/
lustre
/
osc
/
osc_lock.c
diff --git
a/lustre/osc/osc_lock.c
b/lustre/osc/osc_lock.c
index
0e4c083
..
e30e309
100644
(file)
--- a/
lustre/osc/osc_lock.c
+++ b/
lustre/osc/osc_lock.c
@@
-196,14
+196,21
@@
static int osc_lock_unuse(const struct lu_env *env,
{
struct osc_lock *ols = cl2osc_lock(slice);
+ LINVRNT(osc_lock_invariant(ols));
LASSERT(ols->ols_state == OLS_GRANTED ||
+ ols->ols_state == OLS_ENQUEUED ||
ols->ols_state == OLS_UPCALL_RECEIVED);
- LINVRNT(osc_lock_invariant(ols));
+
+ if (ols->ols_state == OLS_ENQUEUED) {
+ ols->ols_state = OLS_CANCELLED;
+ return 0;
+ }
if (ols->ols_glimpse) {
LASSERT(ols->ols_hold == 0);
return 0;
}
+
LASSERT(ols->ols_hold);
/*
@@
-1472,6
+1479,9
@@
static int osc_lock_fits_into(const struct lu_env *env,
if (need->cld_enq_flags & CEF_NEVER)
return 0;
+ if (ols->ols_state >= OLS_CANCELLED)
+ return 0;
+
if (need->cld_mode == CLM_PHANTOM) {
/*
* Note: the QUEUED lock can't be matched here, otherwise