]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gfs2: simplify finish_xmote
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 24 Jun 2025 18:41:37 +0000 (20:41 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 15 Jul 2025 02:20:40 +0000 (04:20 +0200)
As a follow-up to commit a431d49243a0 ("gfs2: Fix request cancelation
bug"), it turns out that any call to finish_xmote() is always followed
by a call to run_queue(), either

 * directly when glock_work_func() calls finish_xmote() before calling
   run_queue(), or

 * indirectly when do_xmote() calls finish_xmote() before calling
   gfs2_glock_queue_work(), which queues a call to glock_work_func() in
   work queue context,

so remove the code in finish_xmote() that duplicates the functionality
of run_queue().

In addition, the code this commit removes is missing a check for the
GLF_DEMOTE flag which indicates that no further promotes should be
performed, so if that code didn't get removed, that check would have to
be added.

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

index a3a5edc28a51c9f5576c66695d40de55fedf17a9..053449a42b496bb377e55ac7663e3b8e2eb6112f 100644 (file)
@@ -616,14 +616,6 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned int ret)
                                list_del_init(&gh->gh_list);
                                trace_gfs2_glock_queue(gh, 0);
                                gl->gl_target = gl->gl_state;
-                               gh = find_first_waiter(gl);
-                               if (gh) {
-                                       gl->gl_target = gh->gh_state;
-                                       if (do_promote(gl))
-                                               goto out;
-                                       do_xmote(gl, gh, gl->gl_target);
-                                       return;
-                               }
                                goto out;
                        }
                        /* Some error or failed "try lock" - report it */