]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gfs2: a minor finish_xmote cleanup
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 23 Jun 2025 20:20:55 +0000 (22:20 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 15 Jul 2025 02:20:40 +0000 (04:20 +0200)
As a minor clean-up to commit 1fc05c8d8426 ("gfs2: cancel timed-out
glock requests"), when a demote request is in progress in
finish_xmote(), there is no point in waking up the glock holder at the
head of the queue because the reply from dlm cannot be on behalf of that
glock holder.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Andrew Price <anprice@redhat.com>
fs/gfs2/glock.c

index 053449a42b496bb377e55ac7663e3b8e2eb6112f..b6fd1cb17de7ba2e476989ce254f1fcc3d76dde4 100644 (file)
@@ -609,12 +609,11 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned int ret)
        if (unlikely(gl->gl_state != gl->gl_target)) {
                struct gfs2_holder *gh = find_first_waiter(gl);
 
-               if (gh && (ret & LM_OUT_CANCELED))
-                       gfs2_holder_wake(gh);
                if (gh && !test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags)) {
                        if (ret & LM_OUT_CANCELED) {
                                list_del_init(&gh->gh_list);
                                trace_gfs2_glock_queue(gh, 0);
+                               gfs2_holder_wake(gh);
                                gl->gl_target = gl->gl_state;
                                goto out;
                        }