Skip to content

Commit 8bbfde0

Browse files
author
Andreas Gruenbacher
committed
gfs2: Add GLF_PENDING_REPLY flag
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 <[email protected]>
1 parent 5788253 commit 8bbfde0

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

fs/gfs2/glock.c

+5
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,7 @@ __acquires(&gl->gl_lockref.lock)
807807
}
808808

809809
if (ls->ls_ops->lm_lock) {
810+
set_bit(GLF_PENDING_REPLY, &gl->gl_flags);
810811
spin_unlock(&gl->gl_lockref.lock);
811812
ret = ls->ls_ops->lm_lock(gl, target, lck_flags);
812813
spin_lock(&gl->gl_lockref.lock);
@@ -825,6 +826,7 @@ __acquires(&gl->gl_lockref.lock)
825826
/* The operation will be completed asynchronously. */
826827
return;
827828
}
829+
clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
828830
}
829831

830832
/* Complete the operation now. */
@@ -1923,6 +1925,7 @@ void gfs2_glock_complete(struct gfs2_glock *gl, int ret)
19231925
struct lm_lockstruct *ls = &gl->gl_name.ln_sbd->sd_lockstruct;
19241926

19251927
spin_lock(&gl->gl_lockref.lock);
1928+
clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
19261929
gl->gl_reply = ret;
19271930

19281931
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)
23232326
*p++ = 'f';
23242327
if (test_bit(GLF_INVALIDATE_IN_PROGRESS, gflags))
23252328
*p++ = 'i';
2329+
if (test_bit(GLF_PENDING_REPLY, gflags))
2330+
*p++ = 'R';
23262331
if (test_bit(GLF_HAVE_REPLY, gflags))
23272332
*p++ = 'r';
23282333
if (test_bit(GLF_INITIAL, gflags))

fs/gfs2/incore.h

+1
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

+1
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)