]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gfs2: Add GLF_PENDING_REPLY flag
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 24 Jan 2025 16:23:50 +0000 (17:23 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 10 Mar 2025 17:15:38 +0000 (18:15 +0100)
Introduce a new GLF_PENDING_REPLY flag to indicate that a reply from DLM
is expected.  Include that flag in glock dumps to show more clearly
what's going on.  (When the GLF_PENDING_REPLY flag is set, the GLF_LOCK
flag will also be set but the GLF_LOCK flag alone isn't sufficient to
tell that we are waiting for a DLM reply.)

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c
fs/gfs2/incore.h
fs/gfs2/trace_gfs2.h

index 8c4c1f871a8896f99ab37a7b84ed314af77c4cde..f6cf5cb8c0226b36819e6424cf564f24088a64a7 100644 (file)
@@ -807,6 +807,7 @@ skip_inval:
        }
 
        if (ls->ls_ops->lm_lock) {
+               set_bit(GLF_PENDING_REPLY, &gl->gl_flags);
                spin_unlock(&gl->gl_lockref.lock);
                ret = ls->ls_ops->lm_lock(gl, target, lck_flags);
                spin_lock(&gl->gl_lockref.lock);
@@ -825,6 +826,7 @@ skip_inval:
                        /* The operation will be completed asynchronously. */
                        return;
                }
+               clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
        }
 
        /* Complete the operation now. */
@@ -1923,6 +1925,7 @@ void gfs2_glock_complete(struct gfs2_glock *gl, int ret)
        struct lm_lockstruct *ls = &gl->gl_name.ln_sbd->sd_lockstruct;
 
        spin_lock(&gl->gl_lockref.lock);
+       clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
        gl->gl_reply = ret;
 
        if (unlikely(test_bit(DFL_BLOCK_LOCKS, &ls->ls_recover_flags))) {
@@ -2323,6 +2326,8 @@ static const char *gflags2str(char *buf, const struct gfs2_glock *gl)
                *p++ = 'f';
        if (test_bit(GLF_INVALIDATE_IN_PROGRESS, gflags))
                *p++ = 'i';
+       if (test_bit(GLF_PENDING_REPLY, gflags))
+               *p++ = 'R';
        if (test_bit(GLF_HAVE_REPLY, gflags))
                *p++ = 'r';
        if (test_bit(GLF_INITIAL, gflags))
index 4e19cce3d906d7468162ec8a1391df1b101e72d0..a8db1120cefcecd220273923006ce7acb7385af1 100644 (file)
@@ -330,6 +330,7 @@ enum {
        GLF_UNLOCKED                    = 16, /* Wait for glock to be unlocked */
        GLF_TRY_TO_EVICT                = 17, /* iopen glocks only */
        GLF_VERIFY_DELETE               = 18, /* iopen glocks only */
+       GLF_PENDING_REPLY               = 19,
 };
 
 struct gfs2_glock {
index ac8ca485c46feb94c1e86a6ec6b778db4fe943b7..09121c2c198ba9707daab9d3c27e4447758aca18 100644 (file)
@@ -53,6 +53,7 @@
        {(1UL << GLF_DIRTY),                    "y" },          \
        {(1UL << GLF_LFLUSH),                   "f" },          \
        {(1UL << GLF_INVALIDATE_IN_PROGRESS),   "i" },          \
+       {(1UL << GLF_PENDING_REPLY),            "R" },          \
        {(1UL << GLF_HAVE_REPLY),               "r" },          \
        {(1UL << GLF_INITIAL),                  "a" },          \
        {(1UL << GLF_HAVE_FROZEN_REPLY),        "F" },          \