Skip to contentSkip to conversation

gfs2: Fix oversight in gfs2_ail1_flush

PATCH Superseded Bob Peterson 2 participants 2 messages Mar 30, 2020 1 message not in the archive GFS2 file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 gfs2: Fix oversight in gfs2_ail1_flush

In reply to a message not in the archive

Hi,

Under ordinary circumstances, function gfs2_ail1_start_one will start an item from the ail1 list writing, then return -EBUSY. This causes gfs2_ail1_flush to loop around and try again. However, it never clears the -EBUSY return code, so on rare occasions, like when the wbc runs out of nr_to_write, it can remain set, which triggers an error and withdraw.

This patch resets the -EBUSY to 0 so this won't happen anymore.

---
 fs/gfs2/log.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/gfs2/log.c +3 -1
index 86c8389e77e4..0752b223b92f 100644
@@ -204,8 +204,10 @@ void gfs2_ail1_flush(struct gfs2_sbd *sdp, struct writeback_control *wbc)
 			break;
 		ret = gfs2_ail1_start_one(sdp, wbc, tr);
 		if (ret) {
-			if (ret == -EBUSY)
+			if (ret == -EBUSY) {
+				ret = 0;
 				goto restart;
+			}
 			break;
 		}
 	}
#2 lore raw

PATCH 1/1 gfs2: Fix oversight in gfs2_ail1_flush

Hi Bob,

Quoted 8 lines · Bob Peterson

Under ordinary circumstances, function gfs2_ail1_start_one will start an item from the ail1 list writing, then return -EBUSY. This causes gfs2_ail1_flush to loop around and try again. However, it never clears the -EBUSY return code, so on rare occasions, like when the wbc runs out of nr_to_write, it can remain set, which triggers an error and withdraw.

This patch resets the -EBUSY to 0 so this won't happen anymore.

this looks ok.

Thanks,
Andreas