gfs2: Add missing set_freezable() for freezable kthread
authorKevin Hao <haokexin@gmail.com>
Mon, 18 Dec 2023 05:35:57 +0000 (13:35 +0800)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 21 Dec 2023 21:53:35 +0000 (22:53 +0100)
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>
fs/gfs2/log.c
fs/gfs2/quota.c

index fdef6bc77c54198a1534e56fe81e9ee6ae59579b..860176989751e58e9fa7d59b715108ec8f6b33e7 100644 (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;
index 9ade69f8d3384288c962527e4f0225d6358f983b..1da9a600db7e941b2a2261056340306cb237acf1 100644 (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;