From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Wed, 13 Nov 2019 15:30:02 -0600 Subject: [Cluster-devel] [PATCH 04/32] gfs2: fix infinite loop in gfs2_ail1_flush on io error In-Reply-To: <20191113213030.237431-1-rpeterso@redhat.com> References: <20191113213030.237431-1-rpeterso@redhat.com> Message-ID: <20191113213030.237431-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, an IO error encountered in function gfs2_ail1_flush would cause a deadlock: because of the io error (and its resulting withdrawn state), buffers stopped being written to the journal. Buffers would remain on the ail1 list, so gfs2_ail1_start_one would return 1 to indicate dirty buffers were still on the ail1 list. However, when function gfs2_ail1_flush got a non-zero return code, it would goto restart to retry the writes, which meant it would never finish, and thus the infinite loop. 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 a36889eea302..6d6013c05e05 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -163,7 +163,7 @@ void gfs2_ail1_flush(struct gfs2_sbd *sdp, struct writeback_control *wbc) list_for_each_entry_reverse(tr, head, tr_list) { if (wbc->nr_to_write <= 0) break; - if (gfs2_ail1_start_one(sdp, wbc, tr)) + if (gfs2_ail1_start_one(sdp, wbc, tr) && !gfs2_withdrawn(sdp)) goto restart; } spin_unlock(&sdp->sd_ail_lock); -- 2.23.0