diff options
Diffstat (limited to 'fs/gfs2/locking')
-rw-r--r-- | fs/gfs2/locking/dlm/lock.c | 3 | ||||
-rw-r--r-- | fs/gfs2/locking/nolock/main.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/fs/gfs2/locking/dlm/lock.c b/fs/gfs2/locking/dlm/lock.c index cf7ea8abec87..fed9a67be0f1 100644 --- a/fs/gfs2/locking/dlm/lock.c +++ b/fs/gfs2/locking/dlm/lock.c | |||
@@ -308,6 +308,9 @@ unsigned int gdlm_lock(void *lock, unsigned int cur_state, | |||
308 | { | 308 | { |
309 | struct gdlm_lock *lp = lock; | 309 | struct gdlm_lock *lp = lock; |
310 | 310 | ||
311 | if (req_state == LM_ST_UNLOCKED) | ||
312 | return gdlm_unlock(lock, cur_state); | ||
313 | |||
311 | clear_bit(LFL_DLM_CANCEL, &lp->flags); | 314 | clear_bit(LFL_DLM_CANCEL, &lp->flags); |
312 | if (flags & LM_FLAG_NOEXP) | 315 | if (flags & LM_FLAG_NOEXP) |
313 | set_bit(LFL_NOBLOCK, &lp->flags); | 316 | set_bit(LFL_NOBLOCK, &lp->flags); |
diff --git a/fs/gfs2/locking/nolock/main.c b/fs/gfs2/locking/nolock/main.c index 284a5ece8d94..627bfb79bc8c 100644 --- a/fs/gfs2/locking/nolock/main.c +++ b/fs/gfs2/locking/nolock/main.c | |||
@@ -107,6 +107,8 @@ static void nolock_put_lock(void *lock) | |||
107 | static unsigned int nolock_lock(void *lock, unsigned int cur_state, | 107 | static unsigned int nolock_lock(void *lock, unsigned int cur_state, |
108 | unsigned int req_state, unsigned int flags) | 108 | unsigned int req_state, unsigned int flags) |
109 | { | 109 | { |
110 | if (req_state == LM_ST_UNLOCKED) | ||
111 | return 0; | ||
110 | return req_state | LM_OUT_CACHEABLE; | 112 | return req_state | LM_OUT_CACHEABLE; |
111 | } | 113 | } |
112 | 114 | ||