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.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index fcd97406a778..99d2cfbce863 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -55,7 +55,12 @@ static void nfs_callback_svc(struct svc_rqst *rqstp)
55 55
56 complete(&nfs_callback_info.started); 56 complete(&nfs_callback_info.started);
57 57
58 while (nfs_callback_info.users != 0 || !signalled()) { 58 for(;;) {
59 if (signalled()) {
60 if (nfs_callback_info.users == 0)
61 break;
62 flush_signals(current);
63 }
59 /* 64 /*
60 * Listen for a request on the socket 65 * Listen for a request on the socket
61 */ 66 */
@@ -73,6 +78,7 @@ static void nfs_callback_svc(struct svc_rqst *rqstp)
73 svc_process(serv, rqstp); 78 svc_process(serv, rqstp);
74 } 79 }
75 80
81 svc_exit_thread(rqstp);
76 nfs_callback_info.pid = 0; 82 nfs_callback_info.pid = 0;
77 complete(&nfs_callback_info.stopped); 83 complete(&nfs_callback_info.stopped);
78 unlock_kernel(); 84 unlock_kernel();
@@ -134,11 +140,13 @@ int nfs_callback_down(void)
134 140
135 lock_kernel(); 141 lock_kernel();
136 down(&nfs_callback_sema); 142 down(&nfs_callback_sema);
137 if (--nfs_callback_info.users || nfs_callback_info.pid == 0) 143 nfs_callback_info.users--;
138 goto out; 144 do {
139 kill_proc(nfs_callback_info.pid, SIGKILL, 1); 145 if (nfs_callback_info.users != 0 || nfs_callback_info.pid == 0)
140 wait_for_completion(&nfs_callback_info.stopped); 146 break;
141out: 147 if (kill_proc(nfs_callback_info.pid, SIGKILL, 1) < 0)
148 break;
149 } while (wait_for_completion_timeout(&nfs_callback_info.stopped, 5*HZ) == 0);
142 up(&nfs_callback_sema); 150 up(&nfs_callback_sema);
143 unlock_kernel(); 151 unlock_kernel();
144 return ret; 152 return ret;