From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Mon, 19 Nov 2018 07:29:21 -0600 Subject: [Cluster-devel] [PATCH 03/13] GFS2: Eliminate a goto in finish_xmote In-Reply-To: <20181119132931.15726-1-rpeterso@redhat.com> References: <20181119132931.15726-1-rpeterso@redhat.com> Message-ID: <20181119132931.15726-4-rpeterso@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- 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