summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2022-04-07 09:50:19 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-15 14:18:38 +0200
commit4ecef6f28aa1ed76b70f27252d3d5febe1e63c8b (patch)
tree6bb12963ccb57b2df4e3bd08ae4d4c34ba04c12b /net
parent9a0da98a36b4bf04774a1b97e1ce538629b44920 (diff)
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 <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/clnt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index bc191d2c193e..08e1ccc01e98 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -2394,6 +2394,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;