aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher2023-08-17 15:46:16 +0200
committerGreg Kroah-Hartman2023-09-19 12:27:58 +0200
commit694e43f22c5b4b52be73b6a2b26dddab382660b6 (patch)
tree03d9a5354cf7328f1f1208466dba92e3c996347c
parentc4807163e2d4cec9ca4a95eb8952a716f9c5ea1c (diff)
gfs2: Switch to wait_event in gfs2_logd
[ Upstream commit 6df373b09b1dcf2f7d579f515f653f89a896d417 ] In gfs2_logd(), switch from an open-coded wait loop to wait_event_interruptible_timeout(). Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Stable-dep-of: b74cd55aa9a9 ("gfs2: low-memory forced flush fixes") Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/gfs2/log.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 61323deb80bc..69c3facfcbef 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -1304,7 +1304,6 @@ int gfs2_logd(void *data)
{
struct gfs2_sbd *sdp = data;
unsigned long t = 1;
- DEFINE_WAIT(wait);
while (!kthread_should_stop()) {
@@ -1341,17 +1340,11 @@ int gfs2_logd(void *data)
try_to_freeze();
- do {
- prepare_to_wait(&sdp->sd_logd_waitq, &wait,
- TASK_INTERRUPTIBLE);
- if (!gfs2_ail_flush_reqd(sdp) &&
- !gfs2_jrnl_flush_reqd(sdp) &&
- !kthread_should_stop())
- t = schedule_timeout(t);
- } while(t && !gfs2_ail_flush_reqd(sdp) &&
- !gfs2_jrnl_flush_reqd(sdp) &&
- !kthread_should_stop());
- finish_wait(&sdp->sd_logd_waitq, &wait);
+ t = wait_event_interruptible_timeout(sdp->sd_logd_waitq,
+ gfs2_ail_flush_reqd(sdp) ||
+ gfs2_jrnl_flush_reqd(sdp) ||
+ kthread_should_stop(),
+ t);
}
return 0;