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 <haokexin@gmail.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
Kevin Hao 2023-12-18 13:35:57 +08:00 committed by Andreas Gruenbacher
parent ff7a85af5a
commit 76e7211ca1
2 changed files with 2 additions and 0 deletions

View file

@ -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;

View file

@ -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;