]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: fix issues in orphan count
authorAmir Vadai <amirv@mellanox.co.il>
Mon, 14 Jun 2010 10:08:36 +0000 (13:08 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:05:01 +0000 (05:05 -0700)
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_main.c

index 47ddb4d730e2ab6e162c71e602fa891b886b8432..fe8da8aa5fa7e0084c027b36987e212cc5cfc00d 100644 (file)
@@ -735,7 +735,7 @@ adjudge_to_death:
         *      consume significant resources. Let's do it with special
         *      linger2 option.                                 --ANK
         */
-       if (sk->sk_state == TCP_FIN_WAIT1) {
+       if ((1 << sk->sk_state) & (TCPF_FIN_WAIT1 | TCPF_TIME_WAIT | TCPF_LAST_ACK)) {
                /* TODO: liger2 unimplemented.
                   We should wait 3.5 * rto. How do I know rto? */
                /* TODO: tcp_fin_time to get timeout */
@@ -1172,6 +1172,8 @@ static void sdp_shutdown(struct sock *sk, int how)
        if (ssk->nonagle & TCP_NAGLE_OFF)
                ssk->nonagle |= TCP_NAGLE_PUSH;
 
+       percpu_counter_inc(ssk->isk.sk.sk_prot->orphan_count);
+
        sdp_send_disconnect(sk);
 }