]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: fix --mkjournal option
authorSage Weil <sage@newdream.net>
Wed, 3 Mar 2010 22:14:42 +0000 (14:14 -0800)
committerSage Weil <sage@newdream.net>
Thu, 4 Mar 2010 18:02:06 +0000 (10:02 -0800)
Read fsid off disk before creating journal.

src/os/FileStore.cc

index 56f2d472892e2db6aa15a6dc0e6e5425e3ce90f8..7bca2b8c159aeceddbb977c4b20d4353ae42f82a 100644 (file)
@@ -325,6 +325,13 @@ int FileStore::mkfs()
 
 int FileStore::mkjournal()
 {
+  // read fsid
+  char fn[PATH_MAX];
+  snprintf(fn, sizeof(fn), "%s/fsid", basedir.c_str());
+  int fd = ::open(fn, O_RDONLY, 0644);
+  ::read(fd, &fsid, sizeof(fsid));
+  ::close(fd);
+
   open_journal();
   if (journal) {
     int err = journal->create();