From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Mon, 9 Dec 2019 09:36:56 -0600 Subject: [Cluster-devel] [GFS2 v8 PATCH 18/22] gfs2: Don't skip log flush if glock still has revokes In-Reply-To: <20191209153700.700208-1-rpeterso@redhat.com> References: <20191209153700.700208-1-rpeterso@redhat.com> Message-ID: <20191209153700.700208-19-rpeterso@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Before this patch,function gfs2_log_flush only did flush work if it saw the LFLUSH flag on the given glock. However, that glock still needs to be flushed if it has revokes attached that are still pending. If we don't flush them, they can be missed in the journal and a journal replay can replay metadata that should have been revoked. This patch adds an additional check to gfs2_log_flush for this condition. Signed-off-by: Bob Peterson --- fs/gfs2/log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index b20eb0bec111..799119fa3ecc 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -799,7 +799,8 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl, u32 flags) down_write(&sdp->sd_log_flush_lock); /* Log might have been flushed while we waited for the flush lock */ - if (gl && !test_bit(GLF_LFLUSH, &gl->gl_flags)) { + if (gl && !test_bit(GLF_LFLUSH, &gl->gl_flags) && + atomic_read(&gl->gl_revokes) == 0) { up_write(&sdp->sd_log_flush_lock); return; } -- 2.23.0