* [Cluster-devel] [GFS2 PATCH] gfs2: fix infinite loop in gfs2_ail1_flush on io error
[not found] <813668675.29723783.1573743165910.JavaMail.zimbra@redhat.com>
@ 2019-11-14 14:52 ` Bob Peterson
0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2019-11-14 14:52 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
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 <rpeterso@redhat.com>
---
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 4a7713c62f04..6ad59fc17565 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -161,7 +161,8 @@ 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, &withdraw))
+ if (gfs2_ail1_start_one(sdp, wbc, tr, &withdraw) &&
+ !gfs2_withdrawn(sdp))
goto restart;
}
spin_unlock(&sdp->sd_ail_lock);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-11-14 14:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <813668675.29723783.1573743165910.JavaMail.zimbra@redhat.com>
2019-11-14 14:52 ` [Cluster-devel] [GFS2 PATCH] gfs2: fix infinite loop in gfs2_ail1_flush on io error Bob Peterson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).