Merge tag 'kvm-4.9-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[cascardo/linux.git] / net / rxrpc / call_accept.c
index 323b8da..3cac231 100644 (file)
@@ -85,6 +85,9 @@ static int rxrpc_service_prealloc_one(struct rxrpc_sock *rx,
                b->conn_backlog[head] = conn;
                smp_store_release(&b->conn_backlog_head,
                                  (head + 1) & (size - 1));
+
+               trace_rxrpc_conn(conn, rxrpc_conn_new_service,
+                                atomic_read(&conn->usage), here);
        }
 
        /* Now it gets complicated, because calls get registered with the
@@ -290,6 +293,7 @@ static struct rxrpc_call *rxrpc_alloc_incoming_call(struct rxrpc_sock *rx,
                rxrpc_get_local(local);
                conn->params.local = local;
                conn->params.peer = peer;
+               rxrpc_see_connection(conn);
                rxrpc_new_incoming_connection(conn, skb);
        } else {
                rxrpc_get_connection(conn);
@@ -327,14 +331,14 @@ struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local,
        struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
        struct rxrpc_sock *rx;
        struct rxrpc_call *call;
+       u16 service_id = sp->hdr.serviceId;
 
        _enter("");
 
        /* Get the socket providing the service */
-       hlist_for_each_entry_rcu_bh(rx, &local->services, listen_link) {
-               if (rx->srx.srx_service == sp->hdr.serviceId)
-                       goto found_service;
-       }
+       rx = rcu_dereference(local->service);
+       if (service_id == rx->srx.srx_service)
+               goto found_service;
 
        trace_rxrpc_abort("INV", sp->hdr.cid, sp->hdr.callNumber, sp->hdr.seq,
                          RX_INVALID_OPERATION, EOPNOTSUPP);
@@ -363,6 +367,9 @@ found_service:
                goto out;
        }
 
+       trace_rxrpc_receive(call, rxrpc_receive_incoming,
+                           sp->hdr.serial, sp->hdr.seq);
+
        /* Make the call live. */
        rxrpc_incoming_call(rx, call, skb);
        conn = call->conn;