Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 601ef0d52e96 ("gfs2: Force withdraw to replay
journals and wait for it to finish").

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>

-38
-2
fs/gfs2/glock.c
··· 2312 2312 *p++ = 'o'; 2313 2313 if (test_bit(GLF_BLOCKING, gflags)) 2314 2314 *p++ = 'b'; 2315 - if (test_bit(GLF_UNLOCKED, gflags)) 2316 - *p++ = 'x'; 2317 2315 if (test_bit(GLF_INSTANTIATE_NEEDED, gflags)) 2318 2316 *p++ = 'n'; 2319 2317 if (test_bit(GLF_INSTANTIATE_IN_PROG, gflags))
-19
fs/gfs2/glops.c
··· 639 639 } 640 640 641 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 - 659 - /** 660 642 * nondisk_go_callback - used to signal when a node did a withdraw 661 643 * @gl: the nondisk glock 662 644 * @remote: true if this came from a different cluster node ··· 700 718 .go_dump = inode_go_dump, 701 719 .go_type = LM_TYPE_INODE, 702 720 .go_flags = GLOF_ASPACE | GLOF_LVB, 703 - .go_unlocked = inode_go_unlocked, 704 721 }; 705 722 706 723 const struct gfs2_glock_operations gfs2_rgrp_glops = {
-2
fs/gfs2/incore.h
··· 223 223 void (*go_dump)(struct seq_file *seq, const struct gfs2_glock *gl, 224 224 const char *fs_id_buf); 225 225 void (*go_callback)(struct gfs2_glock *gl, bool remote); 226 - void (*go_unlocked)(struct gfs2_glock *gl); 227 226 const int go_subclass; 228 227 const int go_type; 229 228 const unsigned long go_flags; ··· 325 326 GLF_LRU = 13, 326 327 GLF_OBJECT = 14, /* Used only for tracing */ 327 328 GLF_BLOCKING = 15, 328 - GLF_UNLOCKED = 16, /* Wait for glock to be unlocked */ 329 329 GLF_TRY_TO_EVICT = 17, /* iopen glocks only */ 330 330 GLF_VERIFY_DELETE = 18, /* iopen glocks only */ 331 331 GLF_PENDING_REPLY = 19,
-4
fs/gfs2/lock_dlm.c
··· 15 15 #include <linux/sched/signal.h> 16 16 17 17 #include "incore.h" 18 - #include "glock.h" 19 - #include "glops.h" 20 18 #include "recovery.h" 21 19 #include "util.h" 22 20 #include "sys.h" ··· 137 139 138 140 switch (gl->gl_lksb.sb_status) { 139 141 case -DLM_EUNLOCK: /* Unlocked, so glock can be freed */ 140 - if (gl->gl_ops->go_unlocked) 141 - gl->gl_ops->go_unlocked(gl); 142 142 gfs2_glock_free(gl); 143 143 return; 144 144 case -DLM_ECANCEL: /* Cancel while getting lock */
-1
fs/gfs2/trace_gfs2.h
··· 59 59 {(1UL << GLF_LRU), "L" }, \ 60 60 {(1UL << GLF_OBJECT), "o" }, \ 61 61 {(1UL << GLF_BLOCKING), "b" }, \ 62 - {(1UL << GLF_UNLOCKED), "x" }, \ 63 62 {(1UL << GLF_INSTANTIATE_NEEDED), "n" }, \ 64 63 {(1UL << GLF_INSTANTIATE_IN_PROG), "N" }, \ 65 64 {(1UL << GLF_TRY_TO_EVICT), "e" }, \
-10
fs/gfs2/util.c
··· 199 199 iput(inode); 200 200 sdp->sd_jdesc->jd_inode = NULL; 201 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 - 211 - /* 212 202 * Dequeue the "live" glock, but keep a reference so it's never freed. 213 203 */ 214 204 gfs2_glock_hold(live_gl);