From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Thu, 23 May 2019 08:04:08 -0500 Subject: [Cluster-devel] [GFS2 PATCH v6 13/26] gfs2: Stop ail1 wait loop when withdrawn In-Reply-To: <20190523130421.21003-1-rpeterso@redhat.com> References: <20190523130421.21003-1-rpeterso@redhat.com> Message-ID: <20190523130421.21003-14-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 could get into an infinite loop trying to clear out its ail1 list. If the file system was withdrawn (or pending withdraw) due to a problem with writing the ail1 list, it would never clear out the list, and therefore, would loop infinitely. This patch changes function gfs2_log_flush so that it does while (!gfs2_withdraw(sdp)) rather than while (;;). Signed-off-by: Bob Peterson --- fs/gfs2/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 9784763fbb4e..2fd43146de00 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -854,7 +854,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl, u32 flags) if (!(flags & GFS2_LOG_HEAD_FLUSH_NORMAL)) { if (!sdp->sd_log_idle) { - for (;;) { + while (!gfs2_withdrawn(sdp)) { gfs2_ail1_start(sdp); gfs2_ail1_wait(sdp); if (gfs2_ail1_empty(sdp)) -- 2.21.0