Skip to content

Commit 51bdb8b

Browse files
committed
gfs2: Add GLF_PENDING_REPLY flag
jira LE-12345 Rebuild_History Non-Buildable kernel-5.14.0-570.12.1.el9_6 commit-author Andreas Gruenbacher <agruenba@redhat.com> commit 8bbfde0 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> (cherry picked from commit 8bbfde0) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 4cea546 commit 51bdb8b

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

fs/gfs2/glock.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ __acquires(&gl->gl_lockref.lock)
810810
}
811811

812812
if (ls->ls_ops->lm_lock) {
813+
set_bit(GLF_PENDING_REPLY, &gl->gl_flags);
813814
spin_unlock(&gl->gl_lockref.lock);
814815
ret = ls->ls_ops->lm_lock(gl, target, lck_flags);
815816
spin_lock(&gl->gl_lockref.lock);
@@ -828,6 +829,7 @@ __acquires(&gl->gl_lockref.lock)
828829
/* The operation will be completed asynchronously. */
829830
return;
830831
}
832+
clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
831833
}
832834

833835
/* Complete the operation now. */
@@ -1929,6 +1931,7 @@ void gfs2_glock_complete(struct gfs2_glock *gl, int ret)
19291931
struct lm_lockstruct *ls = &gl->gl_name.ln_sbd->sd_lockstruct;
19301932

19311933
spin_lock(&gl->gl_lockref.lock);
1934+
clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
19321935
gl->gl_reply = ret;
19331936

19341937
if (unlikely(test_bit(DFL_BLOCK_LOCKS, &ls->ls_recover_flags))) {
@@ -2331,6 +2334,8 @@ static const char *gflags2str(char *buf, const struct gfs2_glock *gl)
23312334
*p++ = 'f';
23322335
if (test_bit(GLF_INVALIDATE_IN_PROGRESS, gflags))
23332336
*p++ = 'i';
2337+
if (test_bit(GLF_PENDING_REPLY, gflags))
2338+
*p++ = 'R';
23342339
if (test_bit(GLF_HAVE_REPLY, gflags))
23352340
*p++ = 'r';
23362341
if (test_bit(GLF_INITIAL, gflags))

fs/gfs2/incore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ enum {
330330
GLF_UNLOCKED = 16, /* Wait for glock to be unlocked */
331331
GLF_TRY_TO_EVICT = 17, /* iopen glocks only */
332332
GLF_VERIFY_DELETE = 18, /* iopen glocks only */
333+
GLF_PENDING_REPLY = 19,
333334
};
334335

335336
struct gfs2_glock {

fs/gfs2/trace_gfs2.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
{(1UL << GLF_DIRTY), "y" }, \
5454
{(1UL << GLF_LFLUSH), "f" }, \
5555
{(1UL << GLF_INVALIDATE_IN_PROGRESS), "i" }, \
56+
{(1UL << GLF_PENDING_REPLY), "R" }, \
5657
{(1UL << GLF_HAVE_REPLY), "r" }, \
5758
{(1UL << GLF_INITIAL), "a" }, \
5859
{(1UL << GLF_HAVE_FROZEN_REPLY), "F" }, \

0 commit comments

Comments
 (0)