]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: handle nonexistant file in ager
authorSage Weil <sage@newdream.net>
Sun, 12 Sep 2010 04:00:06 +0000 (21:00 -0700)
committerSage Weil <sage@newdream.net>
Sun, 12 Sep 2010 04:00:06 +0000 (21:00 -0700)
src/osd/Ager.cc

index effcb1281f8c1cb7ddeb2b28e1fc29bfab941f89..7930ab9195bd2dade21e219a5f02a51afed29c31 100644 (file)
@@ -318,8 +318,10 @@ void Ager::load_freelist()
   bufferlist bl;
   bl.push_back(bp);
   int fd = ::open("ebofs.freelist", O_RDONLY);
-  ::read(fd, bl.c_str(), st.st_size);
-  ::close(fd);
+  if (fd >= 0) {
+    ::read(fd, bl.c_str(), st.st_size);
+    ::close(fd);
+  }
 
   //((Ebofs*)store)->_import_freelist(bl);
   store->sync();