From: Bob Peterson Date: Fri, 21 Apr 2023 15:07:10 -0400 Subject: [Cluster-devel] [GFS2 PATCH 4/4] gfs2: gfs2_ail_empty_gl no log flush on error In-Reply-To: <20230421190710.397684-1-rpeterso@redhat.com> References: <20230421190710.397684-1-rpeterso@redhat.com> Message-ID: <20230421190710.397684-5-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_ail_empty_gl called gfs2_log_flush even in cases where it encountered an error. It should probably skip the log flush and leave the file system in an inconsistent state, letting a subsequent withdraw force the journal to be replayed to reestablish metadata consistency. Signed-off-by: Bob Peterson --- fs/gfs2/glops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 4b3949f2020b..ef31218060aa 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -132,8 +132,9 @@ static int gfs2_ail_empty_gl(struct gfs2_glock *gl) } flush: - gfs2_log_flush(sdp, NULL, GFS2_LOG_HEAD_FLUSH_NORMAL | - GFS2_LFC_AIL_EMPTY_GL); + if (!ret) + gfs2_log_flush(sdp, NULL, GFS2_LOG_HEAD_FLUSH_NORMAL | + GFS2_LFC_AIL_EMPTY_GL); return ret; } -- 2.39.2