projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
776a74c
)
tipc: change lock_sock order in connect()
author
wangweidong
<
[email protected]
>
Thu, 12 Dec 2013 01:36:42 +0000
(09:36 +0800)
committer
David S. Miller
<
[email protected]
>
Mon, 16 Dec 2013 17:48:35 +0000
(12:48 -0500)
Instead of reaquiring the socket lock and taking the normal exit
path when a connection times out, we bail out early with a
return -ETIMEDOUT.
Reviewed-by: Jon Maloy <
[email protected]
>
Reviewed-by: Erik Hugne <
[email protected]
>
Signed-off-by: Wang Weidong <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/tipc/socket.c
patch
|
blob
|
history
diff --git
a/net/tipc/socket.c
b/net/tipc/socket.c
index 844bf349bb819f1531986aabc073dca747485606..83f466e57feaa23e3fca04cc2cde4256ada86c33 100644
(file)
--- a/
net/tipc/socket.c
+++ b/
net/tipc/socket.c
@@
-1507,14
+1507,12
@@
static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
sock->state != SS_CONNECTING,
timeout ? (long)msecs_to_jiffies(timeout)
: MAX_SCHEDULE_TIMEOUT);
- lock_sock(sk);
if (res <= 0) {
if (res == 0)
res = -ETIMEDOUT;
- else
- ; /* leave "res" unchanged */
- goto exit;
+ return res;
}
+ lock_sock(sk);
}
if (unlikely(sock->state == SS_DISCONNECTING))