Before trying to bind a port, ensure we grab the send lock to
ensure that we don't change the port while another task is busy
transmitting requests.
The connect code already takes the send lock in xprt_connect(),
but it is harmless to take it before that.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
dprint_status(task);
task->tk_action = call_bind_status;
+ if (!xprt_prepare_transmit(task))
+ return;
+
task->tk_timeout = xprt->bind_timeout;
xprt->ops->rpcbind(task);
}
task->tk_rebind_retry--;
rpc_delay(task, 3*HZ);
goto retry_timeout;
+ case -EAGAIN:
+ goto retry_timeout;
case -ETIMEDOUT:
dprintk("RPC: %5u rpcbind request timed out\n",
task->tk_pid);
retry_timeout:
task->tk_status = 0;
- task->tk_action = call_encode;
+ task->tk_action = call_bind;
rpc_check_timeout(task);
}
rpc_exit(task, -ENOTCONN);
return;
}
+ if (!xprt_prepare_transmit(task))
+ return;
xprt_connect(task);
}