SUNRPC: preserve fatal network errors during RPC binding
Subsystems (3)
PATCH 1/1 SUNRPC: preserve fatal network errors during RPC binding
call_bind_status() initializes status to -EIO. When an unbound transport's port lookup fails with -ENETDOWN or -ENETUNREACH and RPC_TASK_NETUNREACH_FATAL is set, the function exits the switch without updating status. The RPC task then reports -EIO instead of the network error.
This can occur during NFSv3 port discovery with nconnect, when an additional transport has not yet bound.
Preserve task->tk_status in the fatal branch. Leave the nonfatal retry handling unchanged.
Fixes 9827144bfb2b ("NFS: Treat ENETUNREACH errors as fatal in containers")
Signed-off-by Avi Weiss <[email protected]>
--- net/sunrpc/clnt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/sunrpc/clnt.c +3 -1
@@ -2125,8 +2125,10 @@ call_bind_status(struct rpc_task *task) goto retry_timeout;case -ENETDOWN :case -ENETUNREACH : -if (task->tk_flags &RPC_TASK_NETUNREACH_FATAL ) +if (task->tk_flags &RPC_TASK_NETUNREACH_FATAL ) { + status = task->tk_status;break ; + } fallthrough;case -ECONNREFUSED :/* connection problems */ case -ECONNRESET :
base-commit: 7be4bc52fd9e0e55dc9a2e0232b89427d2c4b614
Signature · 1 line
2.43.0