From: Trond Myklebust <trond.myklebust@hammerspace.com>
Date: Thu, 7 Apr 2022 09:50:19 -0400
Subject: [PATCH] SUNRPC: Handle low memory situations in call_status()
Mime-version: 1.0
Content-type: text/plain; charset=UTF-8
Content-transfer-encoding: 8bit
Git-commit: 9d82819d5b065348ce623f196bf601028e22ed00
Patch-mainline: v5.18
References: git-fixes
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>
Acked-by: NeilBrown <neilb@suse.com>
---
net/sunrpc/clnt.c | 3 +++
1 file changed, 3 insertions(+)
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -2245,7 +2245,10 @@ call_status(struct rpc_task *task)
task->tk_action = call_bind;
break;
case -ENOBUFS:
+ case -ENFILE:
+ case -ENOMEM:
rpc_delay(task, HZ>>2);
+ break;
case -EAGAIN:
task->tk_action = call_transmit;
break;