From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Tue, 30 Apr 2019 17:03:08 -0600 Subject: [Cluster-devel] [GFS2 PATCH v3 08/19] gfs2: Stop ail1 wait loop when withdrawn In-Reply-To: <20190430230319.10375-1-rpeterso@redhat.com> References: <20190430230319.10375-1-rpeterso@redhat.com> Message-ID: <20190430230319.10375-9-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 33ef2cb570e2..6169276aa9e6 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.20.1