Merge tag 'ceph-for-5.6-rc1' of https://github.com/ceph/ceph-client
[linux-2.6-microblaze.git] / net / rxrpc / peer_event.c
index 48f67a9..923b263 100644 (file)
@@ -364,27 +364,31 @@ static void rxrpc_peer_keepalive_dispatch(struct rxrpc_net *rxnet,
                if (!rxrpc_get_peer_maybe(peer))
                        continue;
 
-               spin_unlock_bh(&rxnet->peer_hash_lock);
-
-               keepalive_at = peer->last_tx_at + RXRPC_KEEPALIVE_TIME;
-               slot = keepalive_at - base;
-               _debug("%02x peer %u t=%d {%pISp}",
-                      cursor, peer->debug_id, slot, &peer->srx.transport);
+               if (__rxrpc_use_local(peer->local)) {
+                       spin_unlock_bh(&rxnet->peer_hash_lock);
+
+                       keepalive_at = peer->last_tx_at + RXRPC_KEEPALIVE_TIME;
+                       slot = keepalive_at - base;
+                       _debug("%02x peer %u t=%d {%pISp}",
+                              cursor, peer->debug_id, slot, &peer->srx.transport);
+
+                       if (keepalive_at <= base ||
+                           keepalive_at > base + RXRPC_KEEPALIVE_TIME) {
+                               rxrpc_send_keepalive(peer);
+                               slot = RXRPC_KEEPALIVE_TIME;
+                       }
 
-               if (keepalive_at <= base ||
-                   keepalive_at > base + RXRPC_KEEPALIVE_TIME) {
-                       rxrpc_send_keepalive(peer);
-                       slot = RXRPC_KEEPALIVE_TIME;
+                       /* A transmission to this peer occurred since last we
+                        * examined it so put it into the appropriate future
+                        * bucket.
+                        */
+                       slot += cursor;
+                       slot &= mask;
+                       spin_lock_bh(&rxnet->peer_hash_lock);
+                       list_add_tail(&peer->keepalive_link,
+                                     &rxnet->peer_keepalive[slot & mask]);
+                       rxrpc_unuse_local(peer->local);
                }
-
-               /* A transmission to this peer occurred since last we examined
-                * it so put it into the appropriate future bucket.
-                */
-               slot += cursor;
-               slot &= mask;
-               spin_lock_bh(&rxnet->peer_hash_lock);
-               list_add_tail(&peer->keepalive_link,
-                             &rxnet->peer_keepalive[slot & mask]);
                rxrpc_put_peer_locked(peer);
        }