gfs2: fix infinite loop in gfs2_ail1_flush on io error
authorBob Peterson <rpeterso@redhat.com>
Thu, 14 Nov 2019 14:52:54 +0000 (09:52 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 14 Nov 2019 18:46:43 +0000 (19:46 +0100)
commitf155f5e01090beb317698df00629b7af4e18df6b
tree97273fb0c7743cb7ea787cc79b7f8d3a3f2a7992
parenteb43e660c094029fc1165e2641ce06c153129bdd
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>
fs/gfs2/log.c