mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
Revert "tcp: deny tcp_disconnect() when threads are waiting"
This reverts commit c2251ce048.
It breaks the Android KABI and will be brought back at a later time when
it is safe to do so.
Bug: 161946584
Change-Id: Ie84b5bfe5abc526a6117e5ee320a19ecf04b89bb
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -335,7 +335,6 @@ struct sk_filter;
|
|||||||
* @sk_cgrp_data: cgroup data for this cgroup
|
* @sk_cgrp_data: cgroup data for this cgroup
|
||||||
* @sk_memcg: this socket's memory cgroup association
|
* @sk_memcg: this socket's memory cgroup association
|
||||||
* @sk_write_pending: a write to stream socket waits to start
|
* @sk_write_pending: a write to stream socket waits to start
|
||||||
* @sk_wait_pending: number of threads blocked on this socket
|
|
||||||
* @sk_state_change: callback to indicate change in the state of the sock
|
* @sk_state_change: callback to indicate change in the state of the sock
|
||||||
* @sk_data_ready: callback to indicate there is data to be processed
|
* @sk_data_ready: callback to indicate there is data to be processed
|
||||||
* @sk_write_space: callback to indicate there is bf sending space available
|
* @sk_write_space: callback to indicate there is bf sending space available
|
||||||
@@ -428,7 +427,6 @@ struct sock {
|
|||||||
unsigned int sk_napi_id;
|
unsigned int sk_napi_id;
|
||||||
#endif
|
#endif
|
||||||
int sk_rcvbuf;
|
int sk_rcvbuf;
|
||||||
int sk_wait_pending;
|
|
||||||
|
|
||||||
struct sk_filter __rcu *sk_filter;
|
struct sk_filter __rcu *sk_filter;
|
||||||
union {
|
union {
|
||||||
@@ -1184,7 +1182,6 @@ static inline void sock_rps_reset_rxhash(struct sock *sk)
|
|||||||
|
|
||||||
#define sk_wait_event(__sk, __timeo, __condition, __wait) \
|
#define sk_wait_event(__sk, __timeo, __condition, __wait) \
|
||||||
({ int __rc; \
|
({ int __rc; \
|
||||||
__sk->sk_wait_pending++; \
|
|
||||||
release_sock(__sk); \
|
release_sock(__sk); \
|
||||||
__rc = __condition; \
|
__rc = __condition; \
|
||||||
if (!__rc) { \
|
if (!__rc) { \
|
||||||
@@ -1194,7 +1191,6 @@ static inline void sock_rps_reset_rxhash(struct sock *sk)
|
|||||||
} \
|
} \
|
||||||
sched_annotate_sleep(); \
|
sched_annotate_sleep(); \
|
||||||
lock_sock(__sk); \
|
lock_sock(__sk); \
|
||||||
__sk->sk_wait_pending--; \
|
|
||||||
__rc = __condition; \
|
__rc = __condition; \
|
||||||
__rc; \
|
__rc; \
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -589,7 +589,6 @@ static long inet_wait_for_connect(struct sock *sk, long timeo, int writebias)
|
|||||||
|
|
||||||
add_wait_queue(sk_sleep(sk), &wait);
|
add_wait_queue(sk_sleep(sk), &wait);
|
||||||
sk->sk_write_pending += writebias;
|
sk->sk_write_pending += writebias;
|
||||||
sk->sk_wait_pending++;
|
|
||||||
|
|
||||||
/* Basic assumption: if someone sets sk->sk_err, he _must_
|
/* Basic assumption: if someone sets sk->sk_err, he _must_
|
||||||
* change state of the socket from TCP_SYN_*.
|
* change state of the socket from TCP_SYN_*.
|
||||||
@@ -605,7 +604,6 @@ static long inet_wait_for_connect(struct sock *sk, long timeo, int writebias)
|
|||||||
}
|
}
|
||||||
remove_wait_queue(sk_sleep(sk), &wait);
|
remove_wait_queue(sk_sleep(sk), &wait);
|
||||||
sk->sk_write_pending -= writebias;
|
sk->sk_write_pending -= writebias;
|
||||||
sk->sk_wait_pending--;
|
|
||||||
return timeo;
|
return timeo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1143,7 +1143,6 @@ struct sock *inet_csk_clone_lock(const struct sock *sk,
|
|||||||
if (newsk) {
|
if (newsk) {
|
||||||
struct inet_connection_sock *newicsk = inet_csk(newsk);
|
struct inet_connection_sock *newicsk = inet_csk(newsk);
|
||||||
|
|
||||||
newsk->sk_wait_pending = 0;
|
|
||||||
inet_sk_set_state(newsk, TCP_SYN_RECV);
|
inet_sk_set_state(newsk, TCP_SYN_RECV);
|
||||||
newicsk->icsk_bind_hash = NULL;
|
newicsk->icsk_bind_hash = NULL;
|
||||||
newicsk->icsk_bind2_hash = NULL;
|
newicsk->icsk_bind2_hash = NULL;
|
||||||
|
|||||||
@@ -3088,12 +3088,6 @@ int tcp_disconnect(struct sock *sk, int flags)
|
|||||||
int old_state = sk->sk_state;
|
int old_state = sk->sk_state;
|
||||||
u32 seq;
|
u32 seq;
|
||||||
|
|
||||||
/* Deny disconnect if other threads are blocked in sk_wait_event()
|
|
||||||
* or inet_wait_for_connect().
|
|
||||||
*/
|
|
||||||
if (sk->sk_wait_pending)
|
|
||||||
return -EBUSY;
|
|
||||||
|
|
||||||
if (old_state != TCP_CLOSE)
|
if (old_state != TCP_CLOSE)
|
||||||
tcp_set_state(sk, TCP_CLOSE);
|
tcp_set_state(sk, TCP_CLOSE);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user