]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Accepter: do not unlearn_addr on bind() 2275/head
authorSage Weil <sage@redhat.com>
Mon, 25 Aug 2014 04:18:00 +0000 (21:18 -0700)
committerSage Weil <sage@redhat.com>
Mon, 25 Aug 2014 04:18:00 +0000 (21:18 -0700)
It is dangerous to set need_addr = true as it means someone may set the
addr to something else (specifically the port) in a racing thread.

However, it is not necessary: the only reason we added it way back in
5d5045d31a9e10d21b44eb1bd137db9ae53128ff was so that
local_connection->peer_addr would get updated, and bind() now calls that
unconditionally.

Fixes: #9079
Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
src/msg/Accepter.cc
src/msg/SimpleMessenger.cc
src/msg/SimpleMessenger.h

index 718d4785e28e22e8286856fc80d02662f278ead1..029a037bdbd7f71b23961db148bf5d8f054bda8c 100644 (file)
@@ -152,9 +152,6 @@ int Accepter::rebind(const set<int>& avoid_ports)
 {
   ldout(msgr->cct,1) << "accepter.rebind avoid " << avoid_ports << dendl;
   
-  // invalidate our previously learned address.
-  msgr->unlearn_addr();
-
   entity_addr_t addr = msgr->get_myaddr();
   set<int> new_avoid = avoid_ports;
   new_avoid.insert(addr.get_port());
index 6001acf3a60ee267de566758b82173ad2f45868f..f1f052bce92a60b47413b0c5c406adc0a4d0e0bc 100644 (file)
@@ -694,13 +694,6 @@ void SimpleMessenger::learned_addr(const entity_addr_t &peer_addr_for_me)
   lock.Unlock();
 }
 
-void SimpleMessenger::unlearn_addr()
-{
-  lock.Lock();
-  need_addr = true;
-  lock.Unlock();
-}
-
 void SimpleMessenger::init_local_connection()
 {
   local_connection->peer_addr = my_inst.addr;
index 2943db9d454e3017cb74979377371c69be96474e..006b60be69586cb23491e2246edc15fb17638a22 100644 (file)
@@ -385,13 +385,6 @@ public:
    */
   void learned_addr(const entity_addr_t& peer_addr_for_me);
 
-  /**
-   * Tell the SimpleMessenger its address is no longer known
-   *
-   * This happens when we rebind to a new port.
-   */
-  void unlearn_addr();
-
   /**
    * Release memory accounting back to the dispatch throttler.
    *