SUNRPC: Don't allow waiting for exiting tasks
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 28 Mar 2025 16:52:52 +0000 (12:52 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 28 Mar 2025 20:37:57 +0000 (16:37 -0400)
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>
net/sunrpc/sched.c

index 9b45fbdc90cabec75582bfc1a583f4db5486eacf..73bc39281ef5f5953f9b64734f30e808a6f6bee2 100644 (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)
 {
+       if (unlikely(current->flags & PF_EXITING))
+               return -EINTR;
        schedule();
        if (signal_pending_state(mode, current))
                return -ERESTARTSYS;