]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: return on error creating fsid file
authorSage Weil <sage@newdream.net>
Mon, 13 Sep 2010 03:22:41 +0000 (20:22 -0700)
committerSage Weil <sage@newdream.net>
Mon, 13 Sep 2010 03:25:18 +0000 (20:25 -0700)
src/os/FileStore.cc

index 1138d2e25490790fd74ad3811232e40ee34ccf7f..dbd8452b21c4f8ebc18f380e117725443441ea44 100644 (file)
@@ -280,6 +280,8 @@ int FileStore::mkfs()
   char fn[PATH_MAX];
   snprintf(fn, sizeof(fn), "%s/fsid", basedir.c_str());
   fsid_fd = ::open(fn, O_CREAT|O_RDWR, 0644);
+  if (fsid_fd < 0)
+    return -errno;
   if (lock_fsid() < 0)
     return -EBUSY;
 
@@ -320,6 +322,8 @@ int FileStore::mkfs()
 
   ::close(fsid_fd);
   fsid_fd = ::open(fn, O_CREAT|O_RDWR, 0644);
+  if (fsid_fd < 0)
+    return -errno;
   if (lock_fsid() < 0)
     return -EBUSY;
   ::write(fsid_fd, &fsid, sizeof(fsid));