]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cosd: Do filestore conversion after common_init_finish
authorSamuel Just <samuel.just@dreamhost.com>
Sat, 3 Sep 2011 01:02:10 +0000 (18:02 -0700)
committerSamuel Just <samuel.just@dreamhost.com>
Sat, 3 Sep 2011 01:03:02 +0000 (18:03 -0700)
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
src/cosd.cc

index 7ff132723a371a713a1c6a784984cf59f706b62e..7e16deba766dc363ec7ec8118390c27035806d06 100644 (file)
@@ -193,15 +193,13 @@ int main(int argc, const char **argv)
     exit(0);
   }
 
-  int err = OSD::convertfs(g_conf->osd_data, g_conf->osd_journal);
-  if (err < 0) {
-    derr << TEXT_RED << " ** ERROR: error converting store " << g_conf->osd_data
-        << ": " << cpp_strerror(-err) << TEXT_NORMAL << dendl;
-    exit(1);
-  }
   if (convertfilestore) {
-    derr << "Converted Filestore " << g_conf->osd_data << dendl;
-    exit(0);
+    int err = OSD::convertfs(g_conf->osd_data, g_conf->osd_journal);
+    if (err < 0) {
+      derr << TEXT_RED << " ** ERROR: error converting store " << g_conf->osd_data
+          << ": " << cpp_strerror(-err) << TEXT_NORMAL << dendl;
+      exit(1);
+    }
   }
   
   string magic;
@@ -293,6 +291,14 @@ int main(int argc, const char **argv)
   // Leave stderr open in case we need to report errors.
   global_init_daemonize(g_ceph_context, CINIT_FLAG_NO_CLOSE_STDERR);
   common_init_finish(g_ceph_context);
+
+  int err = OSD::convertfs(g_conf->osd_data, g_conf->osd_journal);
+  if (err < 0) {
+    derr << TEXT_RED << " ** ERROR: error converting store " << g_conf->osd_data
+        << ": " << cpp_strerror(-err) << TEXT_NORMAL << dendl;
+    exit(1);
+  }
+
   MonClient mc(g_ceph_context);
   if (mc.build_initial_monmap() < 0)
     return -1;