]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Revert "gfs2: Force withdraw to replay journals and wait for it to finish" (2/6)
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 25 Jul 2025 17:01:17 +0000 (19:01 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 26 Nov 2025 23:52:26 +0000 (23:52 +0000)
The current withdraw code duplicates the journal recovery code gfs2
already has for dealing with node failures, and it does so poorly.  That
code was added because when releasing a lockspace, we didn't have a way
to indicate that the lockspace needs recovery.  We now do have this
feature, so the current withdraw code can be removed almost entirely.
This is one of several steps towards that.

Reverts parts of commit 601ef0d52e96 ("gfs2: Force withdraw to replay
journals and wait for it to finish").

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c
fs/gfs2/glops.c
fs/gfs2/incore.h
fs/gfs2/lock_dlm.c
fs/gfs2/trace_gfs2.h
fs/gfs2/util.c

index a3abf418446b1387be01fda711974c9ab2f6ebac..c420838248bec9342c216401865a9022db6f0e08 100644 (file)
@@ -2312,8 +2312,6 @@ static const char *gflags2str(char *buf, const struct gfs2_glock *gl)
                *p++ = 'o';
        if (test_bit(GLF_BLOCKING, gflags))
                *p++ = 'b';
-       if (test_bit(GLF_UNLOCKED, gflags))
-               *p++ = 'x';
        if (test_bit(GLF_INSTANTIATE_NEEDED, gflags))
                *p++ = 'n';
        if (test_bit(GLF_INSTANTIATE_IN_PROG, gflags))
index 242e47926b39d7cdd0cdc9afd921040d97369963..8573ad6a78fb9ec3d0508a88c6009788f1c3c5c9 100644 (file)
@@ -638,24 +638,6 @@ static void iopen_go_callback(struct gfs2_glock *gl, bool remote)
        }
 }
 
-/**
- * inode_go_unlocked - wake up anyone waiting for dlm's unlock ast
- * @gl: glock being unlocked
- *
- * For now, this is only used for the journal inode glock. In withdraw
- * situations, we need to wait for the glock to be unlocked so that we know
- * other nodes may proceed with recovery / journal replay.
- */
-static void inode_go_unlocked(struct gfs2_glock *gl)
-{
-       /* Note that we cannot reference gl_object because it's already set
-        * to NULL by this point in its lifecycle. */
-       if (!test_bit(GLF_UNLOCKED, &gl->gl_flags))
-               return;
-       clear_bit_unlock(GLF_UNLOCKED, &gl->gl_flags);
-       wake_up_bit(&gl->gl_flags, GLF_UNLOCKED);
-}
-
 /**
  * nondisk_go_callback - used to signal when a node did a withdraw
  * @gl: the nondisk glock
@@ -718,7 +700,6 @@ const struct gfs2_glock_operations gfs2_inode_glops = {
        .go_dump = inode_go_dump,
        .go_type = LM_TYPE_INODE,
        .go_flags = GLOF_ASPACE | GLOF_LVB,
-       .go_unlocked = inode_go_unlocked,
 };
 
 const struct gfs2_glock_operations gfs2_rgrp_glops = {
index 191a5fcc5d74821c88afe89cbb953ddb01c2e0bd..c72c06d9e77cd0d95d98dc3b8f7e5a1790ae03d5 100644 (file)
@@ -223,7 +223,6 @@ struct gfs2_glock_operations {
        void (*go_dump)(struct seq_file *seq, const struct gfs2_glock *gl,
                        const char *fs_id_buf);
        void (*go_callback)(struct gfs2_glock *gl, bool remote);
-       void (*go_unlocked)(struct gfs2_glock *gl);
        const int go_subclass;
        const int go_type;
        const unsigned long go_flags;
@@ -326,7 +325,6 @@ enum {
        GLF_LRU                         = 13,
        GLF_OBJECT                      = 14, /* Used only for tracing */
        GLF_BLOCKING                    = 15,
-       GLF_UNLOCKED                    = 16, /* Wait for glock to be unlocked */
        GLF_TRY_TO_EVICT                = 17, /* iopen glocks only */
        GLF_VERIFY_DELETE               = 18, /* iopen glocks only */
        GLF_PENDING_REPLY               = 19,
index 301e17345f52d72a7018cd57cadac9a3c8693331..a118f71adb00344a947a40d68e7f1b588b7110ef 100644 (file)
@@ -15,8 +15,6 @@
 #include <linux/sched/signal.h>
 
 #include "incore.h"
-#include "glock.h"
-#include "glops.h"
 #include "recovery.h"
 #include "util.h"
 #include "sys.h"
@@ -139,8 +137,6 @@ static void gdlm_ast(void *arg)
 
        switch (gl->gl_lksb.sb_status) {
        case -DLM_EUNLOCK: /* Unlocked, so glock can be freed */
-               if (gl->gl_ops->go_unlocked)
-                       gl->gl_ops->go_unlocked(gl);
                gfs2_glock_free(gl);
                return;
        case -DLM_ECANCEL: /* Cancel while getting lock */
index 1c2507a273180bc2035eb839a5a6da2b53008b65..fcfbf68ec725c8b56a6492295afd43f1989bed84 100644 (file)
@@ -59,7 +59,6 @@
        {(1UL << GLF_LRU),                      "L" },          \
        {(1UL << GLF_OBJECT),                   "o" },          \
        {(1UL << GLF_BLOCKING),                 "b" },          \
-       {(1UL << GLF_UNLOCKED),                 "x" },          \
        {(1UL << GLF_INSTANTIATE_NEEDED),       "n" },          \
        {(1UL << GLF_INSTANTIATE_IN_PROG),      "N" },          \
        {(1UL << GLF_TRY_TO_EVICT),             "e" },          \
index 3ffcba4fbbd4e5e578df0b48d3c0d571a3ee90fa..7976135038583d7dce44dc516de0570aa74c95e2 100644 (file)
@@ -198,16 +198,6 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
         */
        iput(inode);
        sdp->sd_jdesc->jd_inode = NULL;
-       /*
-        * Wait until the journal inode's glock is freed. This allows try locks
-        * on other nodes to be successful, otherwise we remain the owner of
-        * the glock as far as dlm is concerned.
-        */
-       if (i_gl->gl_ops->go_unlocked) {
-               set_bit(GLF_UNLOCKED, &i_gl->gl_flags);
-               wait_on_bit(&i_gl->gl_flags, GLF_UNLOCKED, TASK_UNINTERRUPTIBLE);
-       }
-
        /*
         * Dequeue the "live" glock, but keep a reference so it's never freed.
         */