summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/gfs2/glock.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 09af1fe12503..f1383e9445be 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -816,6 +816,12 @@ skip_inval:
ret = ls->ls_ops->lm_lock(gl, target, lck_flags);
spin_lock(&gl->gl_lockref.lock);
+ if (!ret) {
+ /* The operation will be completed asynchronously. */
+ return;
+ }
+ clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
+
if (ret == -EINVAL && gl->gl_target == LM_ST_UNLOCKED &&
target == LM_ST_UNLOCKED &&
test_bit(DFL_UNMOUNT, &ls->ls_recover_flags)) {
@@ -823,14 +829,10 @@ skip_inval:
* The lockspace has been released and the lock has
* been unlocked implicitly.
*/
- } else if (ret) {
+ } else {
fs_err(sdp, "lm_lock ret %d\n", ret);
target = gl->gl_state | LM_OUT_ERROR;
- } else {
- /* The operation will be completed asynchronously. */
- return;
}
- clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
}
/* Complete the operation now. */