From: Sage Weil Date: Fri, 14 Oct 2011 23:49:28 +0000 (-0700) Subject: filestore: assert on any unexpected error X-Git-Tag: v0.38~63^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b5c606230f7e002115d3b86e64dac9dbb4ffedef;p=ceph.git filestore: assert on any unexpected error 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 --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 4550bfc84926..200151bc66a4 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -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