]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/cephfs: don't bind to public_addr 40762/head
authorYan, Zheng <zyan@redhat.com>
Thu, 7 May 2020 08:44:14 +0000 (16:44 +0800)
committerNathan Cutler <ncutler@suse.com>
Sat, 10 Apr 2021 20:54:11 +0000 (22:54 +0200)
In some setup, binding to public_addr causes error:
 NetHandler create_socket couldn't create socket (97) Address family not supported by protocol

Fixes: https://tracker.ceph.com/issues/41034
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit 6d2d51499838dc5f34376c6605ec246db3547ceb)

Conflicts:
src/ceph_syn.cc
src/tools/cephfs/MDSUtility.cc
- octopus does not have poolctx

src/ceph_syn.cc
src/tools/cephfs/MDSUtility.cc

index 50e26f2815a00b0f812015f342e56642e7cdbb10..5c469474d7f145fd28feaf45280dcc4e60ec759d 100644 (file)
@@ -63,7 +63,6 @@ int main(int argc, const char **argv, char *envp[])
   for (int i=0; i<num_client; i++) {
     messengers[i] = Messenger::create_client_messenger(g_ceph_context,
                                                       "synclient");
-    messengers[i]->bind(g_conf()->public_addr);
     mclients[i] = new MonClient(g_ceph_context);
     mclients[i]->build_initial_monmap();
     auto client = new StandaloneClient(messengers[i], mclients[i]);
index eb323a2308cf2ba16dc32d4c6c793b1c0fbb06be..b44c4fdd0b9504ff0e6858292cffbe8d54a69518 100644 (file)
@@ -48,10 +48,6 @@ MDSUtility::~MDSUtility()
 int MDSUtility::init()
 {
   // Initialize Messenger
-  int r = messenger->bind(g_conf()->public_addr);
-  if (r < 0)
-    return r;
-
   messenger->start();
 
   objecter->set_client_incarnation(0);
@@ -72,7 +68,7 @@ int MDSUtility::init()
   monc->set_want_keys(CEPH_ENTITY_TYPE_MON|CEPH_ENTITY_TYPE_OSD|CEPH_ENTITY_TYPE_MDS);
   monc->set_messenger(messenger);
   monc->init();
-  r = monc->authenticate();
+  int r = monc->authenticate();
   if (r < 0) {
     derr << "Authentication failed, did you specify an MDS ID with a valid keyring?" << dendl;
     monc->shutdown();