]> Gentwo Git Trees - linux/.git/commitdiff
Revert "gfs2: Force withdraw to replay journals and wait for it to finish" (1/6)
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 5 Aug 2025 21:43:12 +0000 (23:43 +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/incore.h
fs/gfs2/ops_fstype.c
fs/gfs2/sys.c
fs/gfs2/util.c

index fc9e54cd241b8a9bb512ba3a01717d8fd4496ca6..a3abf418446b1387be01fda711974c9ab2f6ebac 100644 (file)
@@ -757,9 +757,7 @@ __acquires(&gl->gl_lockref.lock)
         * gfs2_gl_hash_clear calls clear_glock) and recovery is complete
         * then it's okay to tell dlm to unlock it.
         */
-       if (glock_blocked_by_withdraw(gl) &&
-           (target != LM_ST_UNLOCKED ||
-            test_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags))) {
+       if (glock_blocked_by_withdraw(gl) && target != LM_ST_UNLOCKED) {
                if (!is_system_glock(gl)) {
                        request_demote(gl, LM_ST_UNLOCKED, 0, false);
                        /*
@@ -1648,7 +1646,6 @@ static void __gfs2_glock_dq(struct gfs2_holder *gh)
 void gfs2_glock_dq(struct gfs2_holder *gh)
 {
        struct gfs2_glock *gl = gh->gh_gl;
-       struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
 
        spin_lock(&gl->gl_lockref.lock);
        if (!gfs2_holder_queued(gh)) {
@@ -1675,24 +1672,6 @@ void gfs2_glock_dq(struct gfs2_holder *gh)
                        goto out;
        }
 
-       /*
-        * If we're in the process of file system withdraw, we cannot just
-        * dequeue any glocks until our journal is recovered, lest we introduce
-        * file system corruption. We need two exceptions to this rule: We need
-        * to allow unlocking of nondisk glocks and the glock for our own
-        * journal that needs recovery.
-        */
-       if (test_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags) &&
-           glock_blocked_by_withdraw(gl) &&
-           gh->gh_gl != sdp->sd_jinode_gl) {
-               sdp->sd_glock_dqs_held++;
-               spin_unlock(&gl->gl_lockref.lock);
-               might_sleep();
-               wait_on_bit(&sdp->sd_flags, SDF_WITHDRAW_RECOVERY,
-                           TASK_UNINTERRUPTIBLE);
-               spin_lock(&gl->gl_lockref.lock);
-       }
-
        __gfs2_glock_dq(gh);
 out:
        spin_unlock(&gl->gl_lockref.lock);
index 7886a4452dafd39fedc5a8dd0251b14ca9d6d656..191a5fcc5d74821c88afe89cbb953ddb01c2e0bd 100644 (file)
@@ -600,8 +600,6 @@ enum {
        SDF_FORCE_AIL_FLUSH     = 9,
        SDF_FREEZE_INITIATOR    = 10,
        SDF_REMOTE_WITHDRAW     = 13, /* Performing remote recovery */
-       SDF_WITHDRAW_RECOVERY   = 14, /* Wait for journal recovery when we are
-                                        withdrawing */
        SDF_KILL                = 15,
        SDF_EVICTING            = 16,
        SDF_FROZEN              = 17,
@@ -760,7 +758,6 @@ struct gfs2_sbd {
        struct gfs2_jdesc *sd_jdesc;
        struct gfs2_holder sd_journal_gh;
        struct gfs2_holder sd_jinode_gh;
-       struct gfs2_glock *sd_jinode_gl;
 
        struct gfs2_holder sd_sc_gh;
        struct buffer_head *sd_sc_bh;
@@ -845,7 +842,6 @@ struct gfs2_sbd {
 
        unsigned long sd_last_warning;
        struct dentry *debugfs_dir;    /* debugfs directory */
-       unsigned long sd_glock_dqs_held;
 };
 
 #define GFS2_BAD_INO 1
index c62bcc413df0e7e422488bac3ea4dc104feebe1f..e4715e88b1432970e1b3ffe23390a9bf1a9d6cc1 100644 (file)
@@ -754,7 +754,6 @@ static int init_journal(struct gfs2_sbd *sdp, int undo)
                }
 
                ip = GFS2_I(sdp->sd_jdesc->jd_inode);
-               sdp->sd_jinode_gl = ip->i_gl;
                error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED,
                                           LM_FLAG_RECOVER | GL_EXACT |
                                           GL_NOCACHE | GL_NOPID,
index 80389fc167a6bdc59aeb0d17f585b55d07328922..a829fb9023d97c0d65088dcb6df0d50344a35a7d 100644 (file)
@@ -85,7 +85,6 @@ static ssize_t status_show(struct gfs2_sbd *sdp, char *buf)
                     "FS Freeze Initiator:      %d\n"
                     "FS Frozen:                %d\n"
                     "Remote Withdraw:          %d\n"
-                    "Withdraw Recovery:        %d\n"
                     "Killing:                  %d\n"
                     "sd_log_error:             %d\n"
                     "sd_log_flush_lock:        %d\n"
@@ -116,7 +115,6 @@ static ssize_t status_show(struct gfs2_sbd *sdp, char *buf)
                     test_bit(SDF_FREEZE_INITIATOR, &f),
                     test_bit(SDF_FROZEN, &f),
                     test_bit(SDF_REMOTE_WITHDRAW, &f),
-                    test_bit(SDF_WITHDRAW_RECOVERY, &f),
                     test_bit(SDF_KILL, &f),
                     sdp->sd_log_error,
                     rwsem_is_locked(&sdp->sd_log_flush_lock),
index da7e4e5037b25477175dc33b96ce8892fc861315..3ffcba4fbbd4e5e578df0b48d3c0d571a3ee90fa 100644 (file)
@@ -134,8 +134,6 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
        i_gl = ip->i_gl;
        no_formal_ino = ip->i_no_formal_ino;
 
-       /* Prevent any glock dq until withdraw recovery is complete */
-       set_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags);
        /*
         * Don't tell dlm we're bailing until we have no more buffers in the
         * wind. If journal had an IO error, the log code should just purge
@@ -173,7 +171,6 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
        if (sdp->sd_lockstruct.ls_ops->lm_lock == NULL) { /* lock_nolock */
                if (!ret)
                        ret = -EIO;
-               clear_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags);
                goto skip_recovery;
        }
        /*
@@ -233,7 +230,6 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
        ret = gfs2_glock_nq(&sdp->sd_live_gh);
 
        gfs2_glock_put(live_gl); /* drop extra reference we acquired */
-       clear_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags);
 
        /*
         * If we actually got the "live" lock in EX mode, there are no other
@@ -288,9 +284,6 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
        else
                fs_warn(sdp, "Journal recovery skipped for jid %d until next "
                        "mount.\n", sdp->sd_lockstruct.ls_jid);
-       fs_warn(sdp, "Glock dequeues delayed: %lu\n", sdp->sd_glock_dqs_held);
-       sdp->sd_glock_dqs_held = 0;
-       wake_up_bit(&sdp->sd_flags, SDF_WITHDRAW_RECOVERY);
 }
 
 void gfs2_lm(struct gfs2_sbd *sdp, const char *fmt, ...)