Skip to content

Commit 4cee5b0

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

4 files changed

Lines changed: 0 additions & 86 deletions

File tree

fs/gfs2/glops.c

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
struct workqueue_struct *gfs2_freeze_wq;
3232

33-
extern struct workqueue_struct *gfs2_control_wq;
34-
3533
static void gfs2_ail_error(struct gfs2_glock *gl, const struct buffer_head *bh)
3634
{
3735
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
@@ -638,55 +636,6 @@ static void iopen_go_callback(struct gfs2_glock *gl, bool remote)
638636
}
639637
}
640638

641-
/**
642-
* nondisk_go_callback - used to signal when a node did a withdraw
643-
* @gl: the nondisk glock
644-
* @remote: true if this came from a different cluster node
645-
*
646-
*/
647-
static void nondisk_go_callback(struct gfs2_glock *gl, bool remote)
648-
{
649-
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
650-
651-
/* Ignore the callback unless it's from another node, and it's the
652-
live lock. */
653-
if (!remote || gl->gl_name.ln_number != GFS2_LIVE_LOCK)
654-
return;
655-
656-
/* First order of business is to cancel the demote request. We don't
657-
* really want to demote a nondisk glock. At best it's just to inform
658-
* us of another node's withdraw. We'll keep it in SH mode. */
659-
clear_bit(GLF_DEMOTE, &gl->gl_flags);
660-
clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags);
661-
662-
/* Ignore the unlock if we're withdrawn, unmounting, or in recovery. */
663-
if (test_bit(SDF_NORECOVERY, &sdp->sd_flags) ||
664-
test_bit(SDF_WITHDRAWN, &sdp->sd_flags) ||
665-
test_bit(SDF_REMOTE_WITHDRAW, &sdp->sd_flags))
666-
return;
667-
668-
/* We only care when a node wants us to unlock, because that means
669-
* they want a journal recovered. */
670-
if (gl->gl_demote_state != LM_ST_UNLOCKED)
671-
return;
672-
673-
if (sdp->sd_args.ar_spectator) {
674-
fs_warn(sdp, "Spectator node cannot recover journals.\n");
675-
return;
676-
}
677-
678-
fs_warn(sdp, "Some node has withdrawn; checking for recovery.\n");
679-
set_bit(SDF_REMOTE_WITHDRAW, &sdp->sd_flags);
680-
/*
681-
* We can't call remote_withdraw directly here or gfs2_recover_journal
682-
* because this is called from the glock unlock function and the
683-
* remote_withdraw needs to enqueue and dequeue the same "live" glock
684-
* we were called from. So we queue it to the control work queue in
685-
* lock_dlm.
686-
*/
687-
queue_delayed_work(gfs2_control_wq, &sdp->sd_control_work, 0);
688-
}
689-
690639
const struct gfs2_glock_operations gfs2_meta_glops = {
691640
.go_type = LM_TYPE_META,
692641
.go_flags = GLOF_NONDISK,
@@ -734,7 +683,6 @@ const struct gfs2_glock_operations gfs2_flock_glops = {
734683
const struct gfs2_glock_operations gfs2_nondisk_glops = {
735684
.go_type = LM_TYPE_NONDISK,
736685
.go_flags = GLOF_NONDISK,
737-
.go_callback = nondisk_go_callback,
738686
};
739687

740688
const struct gfs2_glock_operations gfs2_quota_glops = {

fs/gfs2/incore.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,6 @@ enum {
597597
SDF_SKIP_DLM_UNLOCK = 8,
598598
SDF_FORCE_AIL_FLUSH = 9,
599599
SDF_FREEZE_INITIATOR = 10,
600-
SDF_REMOTE_WITHDRAW = 13, /* Performing remote recovery */
601600
SDF_KILL = 15,
602601
SDF_EVICTING = 16,
603602
SDF_FROZEN = 17,

fs/gfs2/lock_dlm.c

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

1717
#include "incore.h"
18-
#include "recovery.h"
1918
#include "util.h"
2019
#include "sys.h"
2120
#include "trace_gfs2.h"
@@ -395,7 +394,6 @@ static void gdlm_cancel(struct gfs2_glock *gl)
395394
/*
396395
* dlm/gfs2 recovery coordination using dlm_recover callbacks
397396
*
398-
* 0. gfs2 checks for another cluster node withdraw, needing journal replay
399397
* 1. dlm_controld sees lockspace members change
400398
* 2. dlm_controld blocks dlm-kernel locking activity
401399
* 3. dlm_controld within dlm-kernel notifies gfs2 (recover_prep)
@@ -653,28 +651,6 @@ static int control_lock(struct gfs2_sbd *sdp, int mode, uint32_t flags)
653651
&ls->ls_control_lksb, "control_lock");
654652
}
655653

656-
/**
657-
* remote_withdraw - react to a node withdrawing from the file system
658-
* @sdp: The superblock
659-
*/
660-
static void remote_withdraw(struct gfs2_sbd *sdp)
661-
{
662-
struct gfs2_jdesc *jd;
663-
int ret = 0, count = 0;
664-
665-
list_for_each_entry(jd, &sdp->sd_jindex_list, jd_list) {
666-
if (jd->jd_jid == sdp->sd_lockstruct.ls_jid)
667-
continue;
668-
ret = gfs2_recover_journal(jd, true);
669-
if (ret)
670-
break;
671-
count++;
672-
}
673-
674-
/* Now drop the additional reference we acquired */
675-
fs_err(sdp, "Journals checked: %d, ret = %d.\n", count, ret);
676-
}
677-
678654
static void gfs2_control_func(struct work_struct *work)
679655
{
680656
struct gfs2_sbd *sdp = container_of(work, struct gfs2_sbd, sd_control_work.work);
@@ -685,13 +661,6 @@ static void gfs2_control_func(struct work_struct *work)
685661
int recover_size;
686662
int i, error;
687663

688-
/* First check for other nodes that may have done a withdraw. */
689-
if (test_bit(SDF_REMOTE_WITHDRAW, &sdp->sd_flags)) {
690-
remote_withdraw(sdp);
691-
clear_bit(SDF_REMOTE_WITHDRAW, &sdp->sd_flags);
692-
return;
693-
}
694-
695664
spin_lock(&ls->ls_recover_spin);
696665
/*
697666
* No MOUNT_DONE means we're still mounting; control_mount()

fs/gfs2/sys.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ static ssize_t status_show(struct gfs2_sbd *sdp, char *buf)
8484
"Force AIL Flush: %d\n"
8585
"FS Freeze Initiator: %d\n"
8686
"FS Frozen: %d\n"
87-
"Remote Withdraw: %d\n"
8887
"Killing: %d\n"
8988
"sd_log_error: %d\n"
9089
"sd_log_flush_lock: %d\n"
@@ -114,7 +113,6 @@ static ssize_t status_show(struct gfs2_sbd *sdp, char *buf)
114113
test_bit(SDF_FORCE_AIL_FLUSH, &f),
115114
test_bit(SDF_FREEZE_INITIATOR, &f),
116115
test_bit(SDF_FROZEN, &f),
117-
test_bit(SDF_REMOTE_WITHDRAW, &f),
118116
test_bit(SDF_KILL, &f),
119117
sdp->sd_log_error,
120118
rwsem_is_locked(&sdp->sd_log_flush_lock),

0 commit comments

Comments
 (0)