summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2025-03-28 12:52:52 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2025-03-28 16:37:57 -0400
commit14e41b16e8cb677bb440dca2edba8b041646c742 (patch)
treecf2a03528b792fcb832ff4cd4601ced348c80bcd
parent0af5fb5ed3d2fd9e110c6112271f022b744a849a (diff)
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>
-rw-r--r--net/sunrpc/sched.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 9b45fbdc90ca..73bc39281ef5 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -276,6 +276,8 @@ EXPORT_SYMBOL_GPL(rpc_destroy_wait_queue);
static int rpc_wait_bit_killable(struct wait_bit_key *key, int mode)
{
+ if (unlikely(current->flags & PF_EXITING))
+ return -EINTR;
schedule();
if (signal_pending_state(mode, current))
return -ERESTARTSYS;