SUNRPC: Don't allow waiting for exiting tasks

Once a task calls exit_signals() it can no longer be signalled. So do
not allow it to do killable waits.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
Trond Myklebust 2025-03-28 12:52:52 -04:00
parent 0af5fb5ed3
commit 14e41b16e8
1 changed files with 2 additions and 0 deletions

View File

@ -276,6 +276,8 @@ EXPORT_SYMBOL_GPL(rpc_destroy_wait_queue);
static int rpc_wait_bit_killable(struct wait_bit_key *key, int mode) static int rpc_wait_bit_killable(struct wait_bit_key *key, int mode)
{ {
if (unlikely(current->flags & PF_EXITING))
return -EINTR;
schedule(); schedule();
if (signal_pending_state(mode, current)) if (signal_pending_state(mode, current))
return -ERESTARTSYS; return -ERESTARTSYS;