Skip to contentSkip to conversation

SUNRPC: preserve fatal network errors during RPC binding

PATCH New Avi Weiss 1 participant 1 message Oct 22

Subsystems (3)
lore
Share & tools
lore

Avi Weiss

author
#0 lore raw

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")
---
 net/sunrpc/clnt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/sunrpc/clnt.c +3 -1
index 6cedc824cf82..73f8469767d3 100644
@@ -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