summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/log.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2020-03-27 21:23:14 +0100
committerBob Peterson <rpeterso@redhat.com>2020-03-30 14:55:35 +0200
commit75b46c437f6b0f8e37032a407c7373f85f5c26a8 (patch)
tree75261c17c3143398191bf0dca2ff4e391bca79d9 /fs/gfs2/log.c
parentgfs2: change from write to read lock for sd_log_flush_lock in journal replay (diff)
downloadlinux-75b46c437f6b0f8e37032a407c7373f85f5c26a8.tar.xz
linux-75b46c437f6b0f8e37032a407c7373f85f5c26a8.zip
gfs2: Fix oversight in gfs2_ail1_flush
Ordinarily, function gfs2_ail1_start_one issues a write request for one item on the ail1 list, then returns -EBUSY. This makes the caller, gfs2_ail1_flush, loop around and start another. However, it was not clearing the -EBUSY return code each time through the loop. So on rare occasions, like when the wbc runs out of nr_to_write, it remained set to -EBUSY, which triggered an error and withdraw. This patch sets the return code to 0 each time through the restart loop so this won't happen anymore. Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/log.c')
-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 82f356f57045..3a75843ae580 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -188,13 +188,14 @@ void gfs2_ail1_flush(struct gfs2_sbd *sdp, struct writeback_control *wbc)
struct list_head *head = &sdp->sd_ail1_list;
struct gfs2_trans *tr;
struct blk_plug plug;
- int ret = 0;
+ int ret;
unsigned long flush_start = jiffies;
trace_gfs2_ail_flush(sdp, wbc, 1);
blk_start_plug(&plug);
spin_lock(&sdp->sd_ail_lock);
restart:
+ ret = 0;
if (time_after(jiffies, flush_start + (HZ * 600))) {
dump_ail_list(sdp);
goto out;