This is another baby step toward a better glock state machine.
This patch eliminates a goto in function finish_xmote so we can
begin unraveling the cryptic logic with later patches.

Signed-off-by: Bob Peterson <rpete...@redhat.com>
---
 fs/gfs2/glock.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 5f2156f15f05..6e9d53583b73 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -472,11 +472,11 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned 
int ret)
                                        list_move_tail(&gh->gh_list, 
&gl->gl_holders);
                                gh = find_first_waiter(gl);
                                gl->gl_target = gh->gh_state;
-                               goto retry;
-                       }
-                       /* Some error or failed "try lock" - report it */
-                       if ((ret & LM_OUT_ERROR) ||
-                           (gh->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB))) {
+                               state = LM_ST_UNLOCKED;
+                       } else if ((ret & LM_OUT_ERROR) ||
+                                  (gh->gh_flags & (LM_FLAG_TRY |
+                                                   LM_FLAG_TRY_1CB))) {
+                               /* An error or failed "try lock" - report it */
                                gl->gl_target = gl->gl_state;
                                do_error(gl, ret);
                                goto out;
@@ -485,7 +485,6 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned 
int ret)
                switch(state) {
                /* Unlocked due to conversion deadlock, try again */
                case LM_ST_UNLOCKED:
-retry:
                        do_xmote(gl, gl->gl_target);
                        break;
                /* Conversion fails, unlock and try again */
-- 
2.19.1

Reply via email to