diff options
| author | Andreas Gruenbacher <agruenba@redhat.com> | 2025-08-05 23:43:12 +0200 |
|---|---|---|
| committer | Andreas Gruenbacher <agruenba@redhat.com> | 2025-11-26 23:52:26 +0000 |
| commit | 20b44ddbbb0712db15c6946eb94a9e240c1ba271 (patch) | |
| tree | cb260ed20b54e701e8cc3fc1f32df7731f731d9f | |
| parent | 833c93caea00b0aef3e22a08fd20acacf212b6fc (diff) | |
Revert "gfs2: Force withdraw to replay journals and wait for it to finish" (1/6)
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>
| -rw-r--r-- | fs/gfs2/glock.c | 23 | ||||
| -rw-r--r-- | fs/gfs2/incore.h | 4 | ||||
| -rw-r--r-- | fs/gfs2/ops_fstype.c | 1 | ||||
| -rw-r--r-- | fs/gfs2/sys.c | 2 | ||||
| -rw-r--r-- | fs/gfs2/util.c | 7 |
5 files changed, 1 insertions, 36 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index fc9e54cd241b..a3abf418446b 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -757,9 +757,7 @@ skip_inval: * 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); diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 7886a4452daf..191a5fcc5d74 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -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 diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index c62bcc413df0..e4715e88b143 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -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, diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index 80389fc167a6..a829fb9023d9 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c @@ -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), diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c index da7e4e5037b2..3ffcba4fbbd4 100644 --- a/fs/gfs2/util.c +++ b/fs/gfs2/util.c @@ -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 @@ skip_recovery: 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, ...) |
