aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2019-11-14 09:52:54 -0500
committerAndreas Gruenbacher <agruenba@redhat.com>2019-11-14 19:46:43 +0100
commitf155f5e01090beb317698df00629b7af4e18df6b (patch)
tree97273fb0c7743cb7ea787cc79b7f8d3a3f2a7992 /fs/gfs2
parentgfs2: Introduce function gfs2_withdrawn (diff)
downloadlinux-dev-f155f5e01090beb317698df00629b7af4e18df6b.tar.xz
linux-dev-f155f5e01090beb317698df00629b7af4e18df6b.zip
gfs2: fix infinite loop in gfs2_ail1_flush on io error
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> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/log.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 68af71eb28c6..72c8f30b1822 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -161,7 +161,8 @@ restart:
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);