From: Michael S. Tsirkin Date: Mon, 11 Sep 2006 13:00:21 +0000 (+0300) Subject: IB/sdp: disable timewait on close if socket has been disconnected X-Git-Tag: v4.1.12-92~264^2~5^2~375 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7f8843c2689d0baf4ed93a3ef465a6c86f872cbb;p=users%2Fjedix%2Flinux-maple.git IB/sdp: disable timewait on close if socket has been disconnected State should move to CLOSE or CLOSE_WAIT etc on disconnect. Since it currently doesn't, do it in sdp_close to avoid timewait. Signed-off-by: Michael S. Tsirkin --- diff --git a/drivers/infiniband/ulp/sdp/sdp_main.c b/drivers/infiniband/ulp/sdp/sdp_main.c index 20e5f47fc524e..366f4f5026bd9 100644 --- a/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/drivers/infiniband/ulp/sdp/sdp_main.c @@ -373,6 +373,11 @@ static void sdp_close(struct sock *sk, long timeout) sdp_post_sends(sdp_sk(sk), 0); } + /* TODO: state should move to CLOSE or CLOSE_WAIT etc on disconnect. + Since it currently doesn't, do it here to avoid blocking below. */ + if (!sdp_sk(sk)->id) + sdp_set_state(sk, TCP_CLOSE); + sk_stream_wait_close(sk, timeout); adjudge_to_death: