From 76e7211ca129f6a9117ae88c020a4c1cafaa24cc Mon Sep 17 00:00:00 2001 From: Kevin Hao Date: Mon, 18 Dec 2023 13:35:57 +0800 Subject: gfs2: Add missing set_freezable() for freezable kthread The kernel thread function gfs2_logd() and gfs2_quotad() invoke the try_to_freeze() in its loop. But all the kernel threads are no-freezable by default. So if we want to make a kernel thread to be freezable, we have to invoke set_freezable() explicitly. Signed-off-by: Kevin Hao Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 1 + fs/gfs2/quota.c | 1 + 2 files changed, 2 insertions(+) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index fdef6bc77c54..860176989751 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -1303,6 +1303,7 @@ int gfs2_logd(void *data) struct gfs2_sbd *sdp = data; unsigned long t = 1; + set_freezable(); while (!kthread_should_stop()) { if (gfs2_withdrawing_or_withdrawn(sdp)) break; diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 9ade69f8d338..1da9a600db7e 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -1583,6 +1583,7 @@ int gfs2_quotad(void *data) unsigned long quotad_timeo = 0; unsigned long t = 0; + set_freezable(); while (!kthread_should_stop()) { if (gfs2_withdrawing_or_withdrawn(sdp)) break; -- cgit v1.2.3