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: b61d59fffd ("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>
This commit is contained in:
Trond Myklebust 2022-04-07 09:50:19 -04:00 committed by Greg Kroah-Hartman
parent 132cbe2f18
commit 9a45e08636

View File

@ -2342,6 +2342,11 @@ call_status(struct rpc_task *task)
case -EPIPE: case -EPIPE:
case -EAGAIN: case -EAGAIN:
break; break;
case -ENFILE:
case -ENOBUFS:
case -ENOMEM:
rpc_delay(task, HZ>>2);
break;
case -EIO: case -EIO:
/* shutdown or soft timeout */ /* shutdown or soft timeout */
goto out_exit; goto out_exit;