From: Trond Myklebust Date: Thu, 7 Apr 2022 13:50:19 +0000 (-0400) Subject: SUNRPC: Handle low memory situations in call_status() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3b32dda29f994f036de528c07221fa72ba721f1c;p=linux.git SUNRPC: Handle low memory situations in call_status() [ Upstream commit 9d82819d5b065348ce623f196bf601028e22ed00 ] We need to handle ENFILE, ENOBUFS, and ENOMEM, because xprt_wake_pending_tasks() can be called with any one of these due to socket creation failures. Fixes: b61d59fffd3e ("SUNRPC: xs_tcp_connect_worker{4,6}: merge common code") Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 9a183c254c840..3286add1a9583 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -2369,6 +2369,11 @@ call_status(struct rpc_task *task) case -EPIPE: case -EAGAIN: break; + case -ENFILE: + case -ENOBUFS: + case -ENOMEM: + rpc_delay(task, HZ>>2); + break; case -EIO: /* shutdown or soft timeout */ goto out_exit;