Commit 2309a013 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher
Browse files

gfs2: do_xmote cleanup



Check for asynchronous completion and clear the GLF_PENDING_REPLY flag
earlier in do_xmote().  This will make future changes more readable.

Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: default avatarAndrew Price <anprice@redhat.com>
parent aa94ad9a
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -816,6 +816,12 @@ __acquires(&gl->gl_lockref.lock)
		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 @@ __acquires(&gl->gl_lockref.lock)
			 * 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. */