Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
40d2549d
Commit
40d2549d
authored
Mar 11, 2009
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SUNRPC: Don't disconnect if a connection is still in progress.
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
670f9457
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
net/sunrpc/xprtsock.c
net/sunrpc/xprtsock.c
+14
-4
No files found.
net/sunrpc/xprtsock.c
View file @
40d2549d
...
@@ -1613,10 +1613,9 @@ static void xs_udp_connect_worker6(struct work_struct *work)
...
@@ -1613,10 +1613,9 @@ static void xs_udp_connect_worker6(struct work_struct *work)
* We need to preserve the port number so the reply cache on the server can
* We need to preserve the port number so the reply cache on the server can
* find our cached RPC replies when we get around to reconnecting.
* find our cached RPC replies when we get around to reconnecting.
*/
*/
static
void
xs_
tcp_reuse_connection
(
struct
rpc_xprt
*
xp
rt
)
static
void
xs_
abort_connection
(
struct
rpc_xprt
*
xprt
,
struct
sock_xprt
*
transpo
rt
)
{
{
int
result
;
int
result
;
struct
sock_xprt
*
transport
=
container_of
(
xprt
,
struct
sock_xprt
,
xprt
);
struct
sockaddr
any
;
struct
sockaddr
any
;
dprintk
(
"RPC: disconnecting xprt %p to reuse port
\n
"
,
xprt
);
dprintk
(
"RPC: disconnecting xprt %p to reuse port
\n
"
,
xprt
);
...
@@ -1633,6 +1632,17 @@ static void xs_tcp_reuse_connection(struct rpc_xprt *xprt)
...
@@ -1633,6 +1632,17 @@ static void xs_tcp_reuse_connection(struct rpc_xprt *xprt)
result
);
result
);
}
}
static
void
xs_tcp_reuse_connection
(
struct
rpc_xprt
*
xprt
,
struct
sock_xprt
*
transport
)
{
unsigned
int
state
=
transport
->
inet
->
sk_state
;
if
(
state
==
TCP_CLOSE
&&
transport
->
sock
->
state
==
SS_UNCONNECTED
)
return
;
if
((
1
<<
state
)
&
(
TCPF_ESTABLISHED
|
TCPF_SYN_SENT
))
return
;
xs_abort_connection
(
xprt
,
transport
);
}
static
int
xs_tcp_finish_connecting
(
struct
rpc_xprt
*
xprt
,
struct
socket
*
sock
)
static
int
xs_tcp_finish_connecting
(
struct
rpc_xprt
*
xprt
,
struct
socket
*
sock
)
{
{
struct
sock_xprt
*
transport
=
container_of
(
xprt
,
struct
sock_xprt
,
xprt
);
struct
sock_xprt
*
transport
=
container_of
(
xprt
,
struct
sock_xprt
,
xprt
);
...
@@ -1706,7 +1716,7 @@ static void xs_tcp_connect_worker4(struct work_struct *work)
...
@@ -1706,7 +1716,7 @@ static void xs_tcp_connect_worker4(struct work_struct *work)
}
}
}
else
}
else
/* "close" the socket, preserving the local port */
/* "close" the socket, preserving the local port */
xs_tcp_reuse_connection
(
xprt
);
xs_tcp_reuse_connection
(
xprt
,
transport
);
dprintk
(
"RPC: worker connecting xprt %p to address: %s
\n
"
,
dprintk
(
"RPC: worker connecting xprt %p to address: %s
\n
"
,
xprt
,
xprt
->
address_strings
[
RPC_DISPLAY_ALL
]);
xprt
,
xprt
->
address_strings
[
RPC_DISPLAY_ALL
]);
...
@@ -1766,7 +1776,7 @@ static void xs_tcp_connect_worker6(struct work_struct *work)
...
@@ -1766,7 +1776,7 @@ static void xs_tcp_connect_worker6(struct work_struct *work)
}
}
}
else
}
else
/* "close" the socket, preserving the local port */
/* "close" the socket, preserving the local port */
xs_tcp_reuse_connection
(
xprt
);
xs_tcp_reuse_connection
(
xprt
,
transport
);
dprintk
(
"RPC: worker connecting xprt %p to address: %s
\n
"
,
dprintk
(
"RPC: worker connecting xprt %p to address: %s
\n
"
,
xprt
,
xprt
->
address_strings
[
RPC_DISPLAY_ALL
]);
xprt
,
xprt
->
address_strings
[
RPC_DISPLAY_ALL
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment