]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: add debugging to each error case in lfn_open
authorJosh Durgin <josh.durgin@dreamhost.com>
Tue, 24 Jan 2012 21:20:20 +0000 (13:20 -0800)
committerJosh Durgin <josh.durgin@dreamhost.com>
Tue, 24 Jan 2012 21:22:21 +0000 (13:22 -0800)
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/os/FileStore.cc

index 6c89f48c017534ad4d02b106308334a62b3d4c66..5719d9eda6f269e979c99d825fd4bfe76c9f0f24 100644 (file)
@@ -244,22 +244,33 @@ int FileStore::lfn_open(coll_t cid, const hobject_t& oid, int flags, mode_t mode
   IndexedPath path;
   int r, fd, exist;
   r = get_index(cid, &index);
-  if (r < 0)
+  if (r < 0) {
+    derr << "error getting collection index for " << cid
+        << ": " << cpp_strerror(-r) << dendl;
     return r;
+  }
   r = index->lookup(oid, &path, &exist);
   if (r < 0) {
+    derr << "could not find " << oid << " in index: "
+        << cpp_strerror(-r) << dendl;
     return r;
   }
 
   r = ::open(path->path(), flags, mode);
-  if (r < 0)
-    return -errno;
+  if (r < 0) {
+    r = -errno;
+    derr << "error opening file " << path->path() << " with flags="
+        << flags << " and mode=" << mode << ": " << cpp_strerror(-r) << dendl;
+    return r;
+  }
   fd = r;
 
   if ((flags & O_CREAT) && (!exist)) {
     r = index->created(oid, path->path());
     if (r < 0) {
       close(fd);
+      derr << "error creating " << oid << " (" << path->path()
+          << ") in index: " << cpp_strerror(-r) << dendl;
       return r;
     }
   }