]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: assert on any unexpected error
authorSage Weil <sage@newdream.net>
Fri, 14 Oct 2011 23:49:28 +0000 (16:49 -0700)
committerSage Weil <sage@newdream.net>
Fri, 14 Oct 2011 23:49:28 +0000 (16:49 -0700)
Right now, the only errors we expect out of the underlying filesystem are
-ENOENT, -ENODATA, or (as a workaround for extN xattr suckage) -ENOSPC
for certain setxattr operations.

Signed-off-by: Sage Weil <sage@newdream.net>
src/os/FileStore.cc

index 4550bfc849268fc49111881a832475220b4c1b20..200151bc66a4c00dd9d2620a6d6305c1e898a964 100644 (file)
@@ -2413,18 +2413,20 @@ unsigned FileStore::_do_transaction(Transaction& t)
       assert(0);
     }
 
-    if (r == -ENOENT && 
-       (op == Transaction::OP_CLONERANGE ||
-        op == Transaction::OP_CLONE ||
-        op == Transaction::OP_CLONERANGE2)) {
-      // Halt before we incorrectly mark the pg clean
-      assert(0 == "ENOENT on clone suggests osd bug");
+    if (r == -ENOENT) {
+      if (op == Transaction::OP_CLONERANGE ||
+         op == Transaction::OP_CLONE ||
+         op == Transaction::OP_CLONERANGE2) {
+       // Halt before we incorrectly mark the pg clean
+       assert(0 == "ENOENT on clone suggests osd bug");
+      } else {
+       // -ENOENT is normally okay
+      }
     }
-      
-    if (r == -ENOTEMPTY) {
-      assert(0 == "ENOTEMPTY suggests garbage data in osd data dir");
+    else if (r == -ENODATA) {
+      // -ENODATA is okay
     }
-    if (r == -ENOSPC) {
+    else if (r == -ENOSPC) {
       // For now, if we hit _any_ ENOSPC, crash, before we do any damage
       // by partially applying transactions.
 
@@ -2435,8 +2437,12 @@ unsigned FileStore::_do_transaction(Transaction& t)
       else
        assert(0 == "ENOSPC handling not implemented");
     }
-    if (r == -EIO) {
-      assert(0 == "EIO handling not implemented");
+    else if (r == -ENOTEMPTY) {
+      assert(0 == "ENOTEMPTY suggests garbage data in osd data dir");
+    }
+    else if (r < 0) {
+      dout(0) << " error " << cpp_strerror(r) << " not handled" << dendl;
+      assert(0 == "unexpected error");
     }
   }
   return 0;  // FIXME count errors