When journals are replayed they start from the last stable point in
the journal. But an rgrp's glock lvb can be updated before the rgrp is
stable in the journal, so another node can see newer lvb values that
reflect changes made after the stable point in the journal.

This patch changes function thaw_glock, which is called after journal
recovery is complete, on every node, regardless of whether or not the
node replayed the journal (and therefore the rgrps). There's no good
way for any given node to determine if its rgrp glocks had been replayed
by a different node from a another node's journal, so it has no way to know
if its lvbs are still valid. So as soon as it knows recovery is complete
and the journals have been properly replayed, it zeroes out the lvbs
for all rgrp glocks. This forces it to re-read the lvb the next time
the glock is held.

Signed-off-by: Bob Peterson <rpete...@redhat.com>
---
 fs/gfs2/glock.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 8dbd6fe66420..24c101287b70 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -2161,6 +2161,8 @@ void gfs2_flush_delete_work(struct gfs2_sbd *sdp)
 
 static void thaw_glock(struct gfs2_glock *gl)
 {
+       if (gl->gl_name.ln_type == LM_TYPE_RGRP)
+               memset(gl->gl_lksb.sb_lvbptr, 0, sizeof(struct gfs2_rgrp_lvb));
        if (!test_and_clear_bit(GLF_FROZEN, &gl->gl_flags))
                return;
        if (!lockref_get_not_dead(&gl->gl_lockref))
-- 
2.33.1

Reply via email to