]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: handle error opening fsid on mkjournal
authorSage Weil <sage@newdream.net>
Mon, 13 Sep 2010 03:26:16 +0000 (20:26 -0700)
committerSage Weil <sage@newdream.net>
Mon, 13 Sep 2010 03:26:16 +0000 (20:26 -0700)
src/os/FileStore.cc

index f69c5582d61d2cbd57b270771570743c7711e161..7b6eb371f3814eabf88123355f7811a3e3dd9399 100644 (file)
@@ -379,6 +379,8 @@ int FileStore::mkjournal()
   char fn[PATH_MAX];
   snprintf(fn, sizeof(fn), "%s/fsid", basedir.c_str());
   int fd = ::open(fn, O_RDONLY, 0644);
+  if (fd < 0)
+    return -errno;
   ::read(fd, &fsid, sizeof(fsid));
   ::close(fd);