Skip to contentSkip to conversation

SUNRPC: Ensure call_connect_status() deals correctly with SOFTCONN tasks

PATCH Applied Steve Dickson 2 participants 2 messages Mar 20, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SUNRPC: Ensure call_connect_status() deals correctly with SOFTCONN tasks

Don't schedule an rpc_delay before checking to see if the task is a SOFTCON because the tk_callback from the delay (__rpc_atrun) clears the task status before the rpc_exit_task can be run.

---
 net/sunrpc/clnt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/sunrpc/clnt.c +2 -2
index cea1308..cb76099 100644
@@ -1802,10 +1802,10 @@ call_connect_status(struct rpc_task *task)
 	case -ECONNABORTED:
 	case -ENETUNREACH:
 	case -EHOSTUNREACH:
-		/* retry with existing socket, after a delay */
-		rpc_delay(task, 3*HZ);
 		if (RPC_IS_SOFTCONN(task))
 			break;
+		/* retry with existing socket, after a delay */
+		rpc_delay(task, 3*HZ);
 	case -EAGAIN:
 		/* Check for timeouts before looping back to call_bind */
 	case -ETIMEDOUT:
Signature · 1 line
1.7.1
#1 lore raw
Quoted 16 lines · Steve Dickson

Don't schedule an rpc_delay before checking to see if the task is a SOFTCON because the tk_callback from the delay (__rpc_atrun) clears the task status before the rpc_exit_task can be run.

---
net/sunrpc/clnt.c | 4 ++--

1 files changed, 2 insertions(+), 2 deletions(-)
net/sunrpc/clnt.c +0 -0
index cea1308..cb76099 100644
@@ -1802,10 +1802,10 @@ call_connect_status(struct rpc_task *task)
 	case -ECONNABORTED:
 	case -ENETUNREACH:

net/sunrpc/clnt.c call_connect_status(struct rpc_task *task) · line 1811

Quoted 10 lines
net/sunrpc/clnt.c +2 -2
 	case -EHOSTUNREACH:
-		/* retry with existing socket, after a delay */
-		rpc_delay(task, 3*HZ);
 		if (RPC_IS_SOFTCONN(task))
 			break;
+		/* retry with existing socket, after a delay */
+		rpc_delay(task, 3*HZ);
 	case -EAGAIN:
 		/* Check for timeouts before looping back to call_bind */
 	case -ETIMEDOUT:

Doh! Good catch!

Applied...

_________________________________
Trond Myklebust
Linux NFS client maintainer, PrimaryData
[email protected]