aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/callback.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/callback.c')
-rw-r--r--fs/nfs/callback.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index c5e27ebd8da8..73a1f928226c 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -76,7 +76,10 @@ nfs4_callback_svc(void *vrqstp)
76 76
77 set_freezable(); 77 set_freezable();
78 78
79 while (!kthread_should_stop()) { 79 while (!kthread_freezable_should_stop(NULL)) {
80
81 if (signal_pending(current))
82 flush_signals(current);
80 /* 83 /*
81 * Listen for a request on the socket 84 * Listen for a request on the socket
82 */ 85 */
@@ -85,6 +88,8 @@ nfs4_callback_svc(void *vrqstp)
85 continue; 88 continue;
86 svc_process(rqstp); 89 svc_process(rqstp);
87 } 90 }
91 svc_exit_thread(rqstp);
92 module_put_and_exit(0);
88 return 0; 93 return 0;
89} 94}
90 95
@@ -103,9 +108,10 @@ nfs41_callback_svc(void *vrqstp)
103 108
104 set_freezable(); 109 set_freezable();
105 110
106 while (!kthread_should_stop()) { 111 while (!kthread_freezable_should_stop(NULL)) {
107 if (try_to_freeze()) 112
108 continue; 113 if (signal_pending(current))
114 flush_signals(current);
109 115
110 prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_INTERRUPTIBLE); 116 prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_INTERRUPTIBLE);
111 spin_lock_bh(&serv->sv_cb_lock); 117 spin_lock_bh(&serv->sv_cb_lock);
@@ -121,11 +127,13 @@ nfs41_callback_svc(void *vrqstp)
121 error); 127 error);
122 } else { 128 } else {
123 spin_unlock_bh(&serv->sv_cb_lock); 129 spin_unlock_bh(&serv->sv_cb_lock);
124 schedule(); 130 if (!kthread_should_stop())
131 schedule();
125 finish_wait(&serv->sv_cb_waitq, &wq); 132 finish_wait(&serv->sv_cb_waitq, &wq);
126 } 133 }
127 flush_signals(current);
128 } 134 }
135 svc_exit_thread(rqstp);
136 module_put_and_exit(0);
129 return 0; 137 return 0;
130} 138}
131 139
@@ -221,14 +229,14 @@ err_bind:
221static struct svc_serv_ops nfs40_cb_sv_ops = { 229static struct svc_serv_ops nfs40_cb_sv_ops = {
222 .svo_function = nfs4_callback_svc, 230 .svo_function = nfs4_callback_svc,
223 .svo_enqueue_xprt = svc_xprt_do_enqueue, 231 .svo_enqueue_xprt = svc_xprt_do_enqueue,
224 .svo_setup = svc_set_num_threads, 232 .svo_setup = svc_set_num_threads_sync,
225 .svo_module = THIS_MODULE, 233 .svo_module = THIS_MODULE,
226}; 234};
227#if defined(CONFIG_NFS_V4_1) 235#if defined(CONFIG_NFS_V4_1)
228static struct svc_serv_ops nfs41_cb_sv_ops = { 236static struct svc_serv_ops nfs41_cb_sv_ops = {
229 .svo_function = nfs41_callback_svc, 237 .svo_function = nfs41_callback_svc,
230 .svo_enqueue_xprt = svc_xprt_do_enqueue, 238 .svo_enqueue_xprt = svc_xprt_do_enqueue,
231 .svo_setup = svc_set_num_threads, 239 .svo_setup = svc_set_num_threads_sync,
232 .svo_module = THIS_MODULE, 240 .svo_module = THIS_MODULE,
233}; 241};
234 242