]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: create a 'ready' file on mkfs completion
authorSage Weil <sage@newdream.net>
Tue, 1 May 2012 20:46:09 +0000 (13:46 -0700)
committerSage Weil <sage@newdream.net>
Tue, 1 May 2012 20:47:27 +0000 (13:47 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/OSD.cc

index be9d0998c982437def03cc414fe56f21e08502db..3e90c17e3d3027cf8d01a31595fd532d8b12ffce 100644 (file)
@@ -287,12 +287,6 @@ int OSD::mkfs(const std::string &dev, const std::string &jdev, uuid_d fsid, int
       derr << "OSD::mkfs: couldn't mount FileStore: error " << ret << dendl;
       goto free_store;
     }
-    store->sync_and_flush();
-    ret = write_meta(dev, sb.cluster_fsid, sb.osd_fsid, whoami);
-    if (ret) {
-      derr << "OSD::mkfs: failed to write fsid file: error " << ret << dendl;
-      goto umount_store;
-    }
 
     // age?
     if (g_conf->osd_age_time != 0) {
@@ -352,6 +346,21 @@ int OSD::mkfs(const std::string &dev, const std::string &jdev, uuid_d fsid, int
        goto umount_store;
       }
     }
+
+    store->sync_and_flush();
+
+    ret = write_meta(dev, sb.cluster_fsid, sb.osd_fsid, whoami);
+    if (ret) {
+      derr << "OSD::mkfs: failed to write fsid file: error " << ret << dendl;
+      goto umount_store;
+    }
+
+    ret = write_meta(dev, "ready", "ready\n", 6);
+    if (ret) {
+      derr << "OSD::mkfs: failed to write ready file: error " << ret << dendl;
+      goto umount_store;
+    }
+
   }
   catch (const std::exception &se) {
     derr << "OSD::mkfs: caught exception " << se.what() << dendl;