From: Kevin Hao Date: Mon, 18 Dec 2023 05:35:57 +0000 (+0800) Subject: gfs2: Add missing set_freezable() for freezable kthread X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=76e7211ca129f6a9117ae88c020a4c1cafaa24cc;p=linux.git 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 --- diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index fdef6bc77c541..860176989751e 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 9ade69f8d3384..1da9a600db7e9 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;