]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/cephfs: don't bind to public_addr 35401/head
authorYan, Zheng <zyan@redhat.com>
Thu, 7 May 2020 08:44:14 +0000 (16:44 +0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 4 Jun 2020 14:03:15 +0000 (16:03 +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
- in nautilus, the immediately succeeding "new MonClient()" call has
  a different number of arguments, but this is irrelevant to the
  backport at hand
        src/tools/cephfs/MDSUtility.cc
- in nautilus, there is no line "poolctx.start(1);" following the
  deleted messenger->bind() call

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 7e7da209bb6a5853ee5ce65e9d618429fc9dcc0c..b5a3219c349f5860af08e668fac61319d17851d1 100644 (file)
@@ -49,10 +49,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);
@@ -73,7 +69,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();