Commit 2bd615797ef32ec06ef0ee44198a7aecc21ffd8c
1 parent
fe650407a8
SUNRPC: Ensure that SIGKILL will always terminate a synchronous RPC call.
...and make sure that the "intr" flag also enables SIGHUP and SIGTERM to interrupt RPC calls too (as per the Solaris implementation). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Showing 2 changed files with 4 additions and 4 deletions Side-by-side Diff
fs/lockd/svc.c
... | ... | @@ -178,6 +178,8 @@ |
178 | 178 | |
179 | 179 | } |
180 | 180 | |
181 | + flush_signals(current); | |
182 | + | |
181 | 183 | /* |
182 | 184 | * Check whether there's a new lockd process before |
183 | 185 | * shutting down the hosts and clearing the slot. |
... | ... | @@ -191,8 +193,6 @@ |
191 | 193 | printk(KERN_DEBUG |
192 | 194 | "lockd: new process, skipping host shutdown\n"); |
193 | 195 | wake_up(&lockd_exit); |
194 | - | |
195 | - flush_signals(current); | |
196 | 196 | |
197 | 197 | /* Exit the RPC thread */ |
198 | 198 | svc_exit_thread(rqstp); |
net/sunrpc/clnt.c
... | ... | @@ -386,11 +386,11 @@ |
386 | 386 | * Export the signal mask handling for synchronous code that |
387 | 387 | * sleeps on RPC calls |
388 | 388 | */ |
389 | -#define RPC_INTR_SIGNALS (sigmask(SIGINT) | sigmask(SIGQUIT) | sigmask(SIGKILL)) | |
389 | +#define RPC_INTR_SIGNALS (sigmask(SIGHUP) | sigmask(SIGINT) | sigmask(SIGQUIT) | sigmask(SIGTERM)) | |
390 | 390 | |
391 | 391 | static void rpc_save_sigmask(sigset_t *oldset, int intr) |
392 | 392 | { |
393 | - unsigned long sigallow = 0; | |
393 | + unsigned long sigallow = sigmask(SIGKILL); | |
394 | 394 | sigset_t sigmask; |
395 | 395 | |
396 | 396 | /* Block all signals except those listed in sigallow */ |