]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: BUG2161 - hanging sockets are left
authorAmir Vadai <amirv@mellanox.co.il>
Tue, 16 Nov 2010 11:32:14 +0000 (13:32 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:05:34 +0000 (05:05 -0700)
When getting DREQ at TCP_CLOSE_WAIT state, CMA ref count is taken
and not returned. This happens because CMA timer is not started.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp.h
drivers/infiniband/ulp/sdp/sdp_cma.c
drivers/infiniband/ulp/sdp/sdp_main.c

index c76bd8b0f2ce2fab2a63eefc55e9b7cd6ea73edf..2c967384adfd9d3aa1dcce9d9510b6f42321764c 100644 (file)
@@ -908,6 +908,7 @@ void sdp_reset_sk(struct sock *sk, int rc);
 void sdp_reset(struct sock *sk);
 int sdp_tx_wait_memory(struct sdp_sock *ssk, long *timeo_p, int *credits_needed);
 void sdp_skb_entail(struct sock *sk, struct sk_buff *skb);
+void sdp_start_cma_timewait_timeout(struct sdp_sock *ssk, int timeo);
 extern struct rw_semaphore device_removal_lock;
 
 /* sdp_proc.c */
index 02e9c2a68dae7d358230ea9b49b0c8187548727f..5ab4c5cfd541a67c2dfe06f13da12db79c304b33 100644 (file)
@@ -476,6 +476,9 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
                                        "TCP_CLOSE_WAIT taking reference to "
                                        "let close() finish the work\n");
                                sock_hold(sk, SOCK_REF_CMA);
+                               sdp_start_cma_timewait_timeout(sdp_sk(sk),
+                                               SDP_CMA_TIMEWAIT_TIMEOUT);
+
                        }
                        sdp_set_error(sk, -EPIPE);
                        rc = sdp_disconnected_handler(sk);
index 38362426991b27e36f777b416e4bc3dee388bb40..9729fad4a1a7c15e8d04f023fed5e17abc2e9d42 100644 (file)
@@ -659,7 +659,7 @@ static int sdp_cancel_cma_timewait_timeout(struct sdp_sock *ssk)
         */
 }
 
-static inline void sdp_start_cma_timewait_timeout(struct sdp_sock *ssk, int timeo)
+void sdp_start_cma_timewait_timeout(struct sdp_sock *ssk, int timeo)
 {
        queue_delayed_work(sdp_wq, &ssk->cma_timewait_work, timeo);
        ssk->cma_timewait_timeout = 1;