Skip to content

Commit d0b9331

Browse files
committed
gfs2: do_xmote cleanup
jira KERNEL-325 Rebuild_History Non-Buildable kernel-4.18.0-553.89.1.el8_10 commit-author Andreas Gruenbacher <agruenba@redhat.com> commit 2309a01 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: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Andrew Price <anprice@redhat.com> (cherry picked from commit 2309a01) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent f1edd62 commit d0b9331

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

fs/gfs2/glock.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -821,21 +821,23 @@ __acquires(&gl->gl_lockref.lock)
821821
ret = ls->ls_ops->lm_lock(gl, target, lck_flags);
822822
spin_lock(&gl->gl_lockref.lock);
823823

824+
if (!ret) {
825+
/* The operation will be completed asynchronously. */
826+
return;
827+
}
828+
clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
829+
824830
if (ret == -EINVAL && gl->gl_target == LM_ST_UNLOCKED &&
825831
target == LM_ST_UNLOCKED &&
826832
test_bit(DFL_UNMOUNT, &ls->ls_recover_flags)) {
827833
/*
828834
* The lockspace has been released and the lock has
829835
* been unlocked implicitly.
830836
*/
831-
} else if (ret) {
837+
} else {
832838
fs_err(sdp, "lm_lock ret %d\n", ret);
833839
target = gl->gl_state | LM_OUT_ERROR;
834-
} else {
835-
/* The operation will be completed asynchronously. */
836-
return;
837840
}
838-
clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
839841
}
840842

841843
/* Complete the operation now. */

0 commit comments

Comments
 (0)