Skip to content

Commit 20b44dd

Browse files
author
Andreas Gruenbacher
committed
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 601ef0d ("gfs2: Force withdraw to replay journals and wait for it to finish"). Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 833c93c commit 20b44dd

5 files changed

Lines changed: 1 addition & 36 deletions

File tree

fs/gfs2/glock.c

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,7 @@ __acquires(&gl->gl_lockref.lock)
757757
* gfs2_gl_hash_clear calls clear_glock) and recovery is complete
758758
* then it's okay to tell dlm to unlock it.
759759
*/
760-
if (glock_blocked_by_withdraw(gl) &&
761-
(target != LM_ST_UNLOCKED ||
762-
test_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags))) {
760+
if (glock_blocked_by_withdraw(gl) && target != LM_ST_UNLOCKED) {
763761
if (!is_system_glock(gl)) {
764762
request_demote(gl, LM_ST_UNLOCKED, 0, false);
765763
/*
@@ -1648,7 +1646,6 @@ static void __gfs2_glock_dq(struct gfs2_holder *gh)
16481646
void gfs2_glock_dq(struct gfs2_holder *gh)
16491647
{
16501648
struct gfs2_glock *gl = gh->gh_gl;
1651-
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
16521649

16531650
spin_lock(&gl->gl_lockref.lock);
16541651
if (!gfs2_holder_queued(gh)) {
@@ -1675,24 +1672,6 @@ void gfs2_glock_dq(struct gfs2_holder *gh)
16751672
goto out;
16761673
}
16771674

1678-
/*
1679-
* If we're in the process of file system withdraw, we cannot just
1680-
* dequeue any glocks until our journal is recovered, lest we introduce
1681-
* file system corruption. We need two exceptions to this rule: We need
1682-
* to allow unlocking of nondisk glocks and the glock for our own
1683-
* journal that needs recovery.
1684-
*/
1685-
if (test_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags) &&
1686-
glock_blocked_by_withdraw(gl) &&
1687-
gh->gh_gl != sdp->sd_jinode_gl) {
1688-
sdp->sd_glock_dqs_held++;
1689-
spin_unlock(&gl->gl_lockref.lock);
1690-
might_sleep();
1691-
wait_on_bit(&sdp->sd_flags, SDF_WITHDRAW_RECOVERY,
1692-
TASK_UNINTERRUPTIBLE);
1693-
spin_lock(&gl->gl_lockref.lock);
1694-
}
1695-
16961675
__gfs2_glock_dq(gh);
16971676
out:
16981677
spin_unlock(&gl->gl_lockref.lock);

fs/gfs2/incore.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,6 @@ enum {
600600
SDF_FORCE_AIL_FLUSH = 9,
601601
SDF_FREEZE_INITIATOR = 10,
602602
SDF_REMOTE_WITHDRAW = 13, /* Performing remote recovery */
603-
SDF_WITHDRAW_RECOVERY = 14, /* Wait for journal recovery when we are
604-
withdrawing */
605603
SDF_KILL = 15,
606604
SDF_EVICTING = 16,
607605
SDF_FROZEN = 17,
@@ -760,7 +758,6 @@ struct gfs2_sbd {
760758
struct gfs2_jdesc *sd_jdesc;
761759
struct gfs2_holder sd_journal_gh;
762760
struct gfs2_holder sd_jinode_gh;
763-
struct gfs2_glock *sd_jinode_gl;
764761

765762
struct gfs2_holder sd_sc_gh;
766763
struct buffer_head *sd_sc_bh;
@@ -845,7 +842,6 @@ struct gfs2_sbd {
845842

846843
unsigned long sd_last_warning;
847844
struct dentry *debugfs_dir; /* debugfs directory */
848-
unsigned long sd_glock_dqs_held;
849845
};
850846

851847
#define GFS2_BAD_INO 1

fs/gfs2/ops_fstype.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,6 @@ static int init_journal(struct gfs2_sbd *sdp, int undo)
754754
}
755755

756756
ip = GFS2_I(sdp->sd_jdesc->jd_inode);
757-
sdp->sd_jinode_gl = ip->i_gl;
758757
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED,
759758
LM_FLAG_RECOVER | GL_EXACT |
760759
GL_NOCACHE | GL_NOPID,

fs/gfs2/sys.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ static ssize_t status_show(struct gfs2_sbd *sdp, char *buf)
8585
"FS Freeze Initiator: %d\n"
8686
"FS Frozen: %d\n"
8787
"Remote Withdraw: %d\n"
88-
"Withdraw Recovery: %d\n"
8988
"Killing: %d\n"
9089
"sd_log_error: %d\n"
9190
"sd_log_flush_lock: %d\n"
@@ -116,7 +115,6 @@ static ssize_t status_show(struct gfs2_sbd *sdp, char *buf)
116115
test_bit(SDF_FREEZE_INITIATOR, &f),
117116
test_bit(SDF_FROZEN, &f),
118117
test_bit(SDF_REMOTE_WITHDRAW, &f),
119-
test_bit(SDF_WITHDRAW_RECOVERY, &f),
120118
test_bit(SDF_KILL, &f),
121119
sdp->sd_log_error,
122120
rwsem_is_locked(&sdp->sd_log_flush_lock),

fs/gfs2/util.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
134134
i_gl = ip->i_gl;
135135
no_formal_ino = ip->i_no_formal_ino;
136136

137-
/* Prevent any glock dq until withdraw recovery is complete */
138-
set_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags);
139137
/*
140138
* Don't tell dlm we're bailing until we have no more buffers in the
141139
* 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)
173171
if (sdp->sd_lockstruct.ls_ops->lm_lock == NULL) { /* lock_nolock */
174172
if (!ret)
175173
ret = -EIO;
176-
clear_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags);
177174
goto skip_recovery;
178175
}
179176
/*
@@ -233,7 +230,6 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
233230
ret = gfs2_glock_nq(&sdp->sd_live_gh);
234231

235232
gfs2_glock_put(live_gl); /* drop extra reference we acquired */
236-
clear_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags);
237233

238234
/*
239235
* 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)
288284
else
289285
fs_warn(sdp, "Journal recovery skipped for jid %d until next "
290286
"mount.\n", sdp->sd_lockstruct.ls_jid);
291-
fs_warn(sdp, "Glock dequeues delayed: %lu\n", sdp->sd_glock_dqs_held);
292-
sdp->sd_glock_dqs_held = 0;
293-
wake_up_bit(&sdp->sd_flags, SDF_WITHDRAW_RECOVERY);
294287
}
295288

296289
void gfs2_lm(struct gfs2_sbd *sdp, const char *fmt, ...)

0 commit comments

Comments
 (0)