Skip to content

Commit 2aae092

Browse files
author
Andreas Gruenbacher
committed
Revert "gfs2: Force withdraw to replay journals and wait for it to finish" (2/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 20b44dd commit 2aae092

6 files changed

Lines changed: 0 additions & 38 deletions

File tree

fs/gfs2/glock.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,8 +2312,6 @@ static const char *gflags2str(char *buf, const struct gfs2_glock *gl)
23122312
*p++ = 'o';
23132313
if (test_bit(GLF_BLOCKING, gflags))
23142314
*p++ = 'b';
2315-
if (test_bit(GLF_UNLOCKED, gflags))
2316-
*p++ = 'x';
23172315
if (test_bit(GLF_INSTANTIATE_NEEDED, gflags))
23182316
*p++ = 'n';
23192317
if (test_bit(GLF_INSTANTIATE_IN_PROG, gflags))

fs/gfs2/glops.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -638,24 +638,6 @@ static void iopen_go_callback(struct gfs2_glock *gl, bool remote)
638638
}
639639
}
640640

641-
/**
642-
* inode_go_unlocked - wake up anyone waiting for dlm's unlock ast
643-
* @gl: glock being unlocked
644-
*
645-
* For now, this is only used for the journal inode glock. In withdraw
646-
* situations, we need to wait for the glock to be unlocked so that we know
647-
* other nodes may proceed with recovery / journal replay.
648-
*/
649-
static void inode_go_unlocked(struct gfs2_glock *gl)
650-
{
651-
/* Note that we cannot reference gl_object because it's already set
652-
* to NULL by this point in its lifecycle. */
653-
if (!test_bit(GLF_UNLOCKED, &gl->gl_flags))
654-
return;
655-
clear_bit_unlock(GLF_UNLOCKED, &gl->gl_flags);
656-
wake_up_bit(&gl->gl_flags, GLF_UNLOCKED);
657-
}
658-
659641
/**
660642
* nondisk_go_callback - used to signal when a node did a withdraw
661643
* @gl: the nondisk glock
@@ -718,7 +700,6 @@ const struct gfs2_glock_operations gfs2_inode_glops = {
718700
.go_dump = inode_go_dump,
719701
.go_type = LM_TYPE_INODE,
720702
.go_flags = GLOF_ASPACE | GLOF_LVB,
721-
.go_unlocked = inode_go_unlocked,
722703
};
723704

724705
const struct gfs2_glock_operations gfs2_rgrp_glops = {

fs/gfs2/incore.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ struct gfs2_glock_operations {
223223
void (*go_dump)(struct seq_file *seq, const struct gfs2_glock *gl,
224224
const char *fs_id_buf);
225225
void (*go_callback)(struct gfs2_glock *gl, bool remote);
226-
void (*go_unlocked)(struct gfs2_glock *gl);
227226
const int go_subclass;
228227
const int go_type;
229228
const unsigned long go_flags;
@@ -326,7 +325,6 @@ enum {
326325
GLF_LRU = 13,
327326
GLF_OBJECT = 14, /* Used only for tracing */
328327
GLF_BLOCKING = 15,
329-
GLF_UNLOCKED = 16, /* Wait for glock to be unlocked */
330328
GLF_TRY_TO_EVICT = 17, /* iopen glocks only */
331329
GLF_VERIFY_DELETE = 18, /* iopen glocks only */
332330
GLF_PENDING_REPLY = 19,

fs/gfs2/lock_dlm.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#include <linux/sched/signal.h>
1616

1717
#include "incore.h"
18-
#include "glock.h"
19-
#include "glops.h"
2018
#include "recovery.h"
2119
#include "util.h"
2220
#include "sys.h"
@@ -139,8 +137,6 @@ static void gdlm_ast(void *arg)
139137

140138
switch (gl->gl_lksb.sb_status) {
141139
case -DLM_EUNLOCK: /* Unlocked, so glock can be freed */
142-
if (gl->gl_ops->go_unlocked)
143-
gl->gl_ops->go_unlocked(gl);
144140
gfs2_glock_free(gl);
145141
return;
146142
case -DLM_ECANCEL: /* Cancel while getting lock */

fs/gfs2/trace_gfs2.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
{(1UL << GLF_LRU), "L" }, \
6060
{(1UL << GLF_OBJECT), "o" }, \
6161
{(1UL << GLF_BLOCKING), "b" }, \
62-
{(1UL << GLF_UNLOCKED), "x" }, \
6362
{(1UL << GLF_INSTANTIATE_NEEDED), "n" }, \
6463
{(1UL << GLF_INSTANTIATE_IN_PROG), "N" }, \
6564
{(1UL << GLF_TRY_TO_EVICT), "e" }, \

fs/gfs2/util.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,6 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
198198
*/
199199
iput(inode);
200200
sdp->sd_jdesc->jd_inode = NULL;
201-
/*
202-
* Wait until the journal inode's glock is freed. This allows try locks
203-
* on other nodes to be successful, otherwise we remain the owner of
204-
* the glock as far as dlm is concerned.
205-
*/
206-
if (i_gl->gl_ops->go_unlocked) {
207-
set_bit(GLF_UNLOCKED, &i_gl->gl_flags);
208-
wait_on_bit(&i_gl->gl_flags, GLF_UNLOCKED, TASK_UNINTERRUPTIBLE);
209-
}
210-
211201
/*
212202
* Dequeue the "live" glock, but keep a reference so it's never freed.
213203
*/

0 commit comments

Comments
 (0)