default:
ldout(cct, 0) << " unknown request_type " << header.request_type << dendl;
- assert(0);
+ ceph_abort();
}
return ret;
}
break;
default:
- assert(0);
+ ceph_abort();
}
}
return CEPH_AUTH_UNKNOWN;
}
int handle_request(bufferlist::iterator& indata, bufferlist& result_bl, uint64_t& global_id, AuthCapsInfo& caps, uint64_t *auid = NULL) {
- assert(0); // shouldn't get called
+ ceph_abort(); // shouldn't get called
return 0;
}
void build_cephx_response_header(int request_type, int status, bufferlist& bl) { }
filer_flags |= CEPH_OSD_FLAG_LOCALIZE_READS;
} else if (ceph_argparse_flag(args, i, "-h", "--help", (char*)NULL)) {
usage();
- assert(0);
+ ceph_abort();
} else {
++i;
}
break;
default:
- assert(0);
+ ceph_abort();
}
m->put();
wait_on_list(waiting_for_mdsmap);
} else {
// Unexpected value!
- assert(0);
+ ceph_abort();
}
}
}
dirp->set_end();
return 0;
}
- assert(0);
+ ceph_abort();
return 0;
}
break;
default:
- assert(0);
+ ceph_abort();
}
ldout(cct, 3) << "_lseek(" << f << ", " << offset << ", " << whence << ") = " << f->pos << dendl;
in->flock_locks = new ceph_lock_state_t(cct, CEPH_LOCK_FLOCK);
lock_state = in->flock_locks;
} else {
- assert(0);
+ ceph_abort();
return -EINVAL;
}
_update_lock_state(fl, owner, lock_state);
_update_lock_state(fl, owner, lock_state);
}
} else
- assert(0);
+ ceph_abort();
}
return ret;
}
else if (req->head.args.filelock_change.rule == CEPH_LOCK_FCNTL)
lock_type = CEPH_LOCK_FCNTL_INTR;
else {
- assert(0);
+ ceph_abort();
return -EINVAL;
}
} else {
lderr(cct) << "no method to invalidate kernel dentry cache; expect issues!" << dendl;
if (cct->_conf->client_die_on_failed_remount)
- assert(0);
+ ceph_abort();
}
return r;
}
syn_sargs.push_back(args[++i]);
} else {
cerr << "unknown syn arg " << args[i] << std::endl;
- assert(0);
+ ceph_abort();
}
}
else if (strcmp(args[i], "localize_reads") == 0) {
break;
default:
- assert(0);
+ ceph_abort();
}
}
dout(1) << "syn done, unmounting " << dendl;
else {
dout(0) << (t.get_line()-1) << ": *** trace hit unrecognized symbol '" << op << "' " << dendl;
- assert(0);
+ ceph_abort();
}
}
it != c.end();
++it) {
//dout(DBL) << " got " << *it << dendl;
- assert(0);
+ ceph_abort();
/*contents[*it] = it->second;
if (it->second &&
S_ISDIR(it->second->st_mode))
fs->open(filename);
if (!fs->is_open()) {
//generic_dout(0) << "** unable to open trace file " << filename << dendl;
- assert(0);
+ ceph_abort();
}
//generic_dout(2) << "opened traced file '" << filename << "'" << dendl;
assert(err);
if (err->error) {
CLS_ERR("error: cls_lua state machine: unexpected error");
- assert(0);
+ ceph_abort();
}
/* everything is cherry */
default:
CLS_ERR("error: unknown encoding type");
ctx->ret = -EFAULT;
- assert(0);
+ ceph_abort();
return 0;
}
struct clslua_err *err = clslua_checkerr(L);
if (!err) {
CLS_ERR("error: cls_lua state machine: unexpected error");
- assert(0);
+ ceph_abort();
}
/* Error origin a cls_cxx_* method? */
f->dump_string("protection_status", "protected");
break;
default:
- assert(0);
+ ceph_abort();
}
}
static void generate_test_instances(list<cls_rbd_snap*>& o) {
comment += c;
break;
default:
- assert(0);
+ ceph_abort();
break;
}
assert(c != '\0'); // We better not go past the end of the input string.
case CLOG_SEC:
return LOG_CRIT;
default:
- assert(0);
+ ceph_abort();
return 0;
}
}
case CLOG_SEC:
return "crit";
default:
- assert(0);
+ ceph_abort();
return 0;
}
}
}
exec();
- assert(0); // Never reached
+ ceph_abort(); // Never reached
}
ret = -errno;
if (timeout <= 0) {
SubProcess::exec();
- assert(0); // Never reached
+ ceph_abort(); // Never reached
}
sigset_t mask, oldmask;
}
(void)setpgid(0, 0); // Become process group leader.
SubProcess::exec();
- assert(0); // Never reached
+ ceph_abort(); // Never reached
}
// Parent
}
return (*p)[n];
}
- assert(0);
+ ceph_abort();
}
/*
out += "$data_dir";
}
} else
- assert(0); // unreachable
+ ceph_abort(); // unreachable
expanded = true;
}
else if (bits == 32)
from.insert(mask);
else
- assert(0);
+ ceph_abort();
set<uint32_t> to;
}
delete bt;
*_dout << dendl;
- assert(0);
+ ceph_abort();
}
else if (!(follows[p->first][id/8] & (1 << (id % 8)))) {
// new dependency
// don't add this dependency, or we'll get aMutex. cycle in the graph, and
// does_follow() won't terminate.
- assert(0); // actually, we should just die here.
+ ceph_abort(); // actually, we should just die here.
} else {
BackTrace *bt = NULL;
if (force_backtrace || lockdep_force_backtrace()) {
return;
data.u64.set(amt.to_nsec());
if (data.type & PERFCOUNTER_LONGRUNAVG)
- assert(0);
+ ceph_abort();
}
utime_t PerfCounters::tget(int idx) const
a.first / 1000000000ull,
a.first % 1000000000ull);
} else {
- assert(0);
+ ceph_abort();
}
f->close_section();
} else {
v / 1000000000ull,
v % 1000000000ull);
} else {
- assert(0);
+ ceph_abort();
}
}
}
return true;
}
void _dequeue(Job *item) {
- assert(0);
+ ceph_abort();
}
bool _empty() {
return job_queue.empty();
}
}
}
- else assert(0);
+ else ceph_abort();
}
// now do the items.
else if (tag == "pos")
pos = int_node(sub->children[q]);
else
- assert(0);
+ ceph_abort();
}
if (alg == CRUSH_BUCKET_UNIFORM) {
else if (tname == "erasure")
type = CEPH_PG_TYPE_ERASURE;
else
- assert(0);
+ ceph_abort();
int minsize = int_node(i->children[start+4]);
int maxsize = int_node(i->children[start+6]);
crush.set_rule_step_choose_firstn(ruleno, step++, int_node(s->children[2]), type_id[type]);
else if (mode == "indep")
crush.set_rule_step_choose_indep(ruleno, step++, int_node(s->children[2]), type_id[type]);
- else assert(0);
+ else ceph_abort();
} else if (choose == "chooseleaf") {
if (mode == "firstn")
crush.set_rule_step_choose_leaf_firstn(ruleno, step++, int_node(s->children[2]), type_id[type]);
else if (mode == "indep")
crush.set_rule_step_choose_leaf_indep(ruleno, step++, int_node(s->children[2]), type_id[type]);
- else assert(0);
- } else assert(0);
+ else ceph_abort();
+ } else ceph_abort();
}
break;
r = parse_rule(p);
break;
default:
- assert(0);
+ ceph_abort();
}
if (r < 0) {
return r;
break;
default:
- assert(0);
+ ceph_abort();
break;
}
}
default:
// We should have handled this case in the first switch statement
- assert(0);
+ ceph_abort();
break;
}
}
return s;
}
void finish(int r) {
- assert(0); // nobody should ever call me.
+ ceph_abort(); // nobody should ever call me.
}
inline int get_sub_existing_count() const {
if (s < p[i]) return v[i];
s -= p[i];
}
- assert(0);
+ ceph_abort();
return v[p.size() - 1]; // hmm. :/
}
/*
* ceph_abort aborts the program with a nice backtrace.
*
- * Currently, it's the same as assert(0), but we may one day make assert a
+ * Currently, it's the same as ceph_abort(), but we may one day make assert a
* debug-only thing, like it is in many projects.
*/
#define ceph_abort() abort()
if (p->first + p->second != start) {
//cout << "p is " << p->first << "~" << p->second << ", start is " << start << ", len is " << len << endl;
- assert(0);
+ ceph_abort();
}
p->second += len; // append to end
else if (mode == CACHE_NEXT)
cur = next;
else
- assert(0);
+ ceph_abort();
next = cur->_next;
return *this;
}
if (p->first + p->second != start) {
//cout << "p is " << p->first << "~" << p->second << ", start is " << start << ", len is " << len << endl;
- assert(0);
+ ceph_abort();
}
p->second += len; // append to end
break;
default:
lderr(image_ctx->cct) << "invalid request state: " << m_state << dendl;
- assert(0);
+ ceph_abort();
}
return finished;
default:
lderr(m_ictx->cct) << "invalid request state: " << m_state << dendl;
- assert(0);
+ ceph_abort();
}
return finished;
}
if (is_protected) {
lderr(ictx->cct) << "snapshot is still protected after unprotection" << dendl;
- assert(0);
+ ceph_abort();
}
}
else if (linkage.is_null()) {
// encode nothing.
}
- else assert(0);
+ else ceph_abort();
}
void CDentry::decode_lock_state(int type, bufferlist& bl)
}
break;
default:
- assert(0);
+ ceph_abort();
}
}
case S_IFDIR: return "dir";
case S_IFCHR: return "chr";
case S_IFIFO: return "fifo";
- default: assert(0); return "";
+ default: ceph_abort(); return "";
}
}
inode->ino(), frag, last, dname);
if (fatal) {
cache->mds->damaged();
- assert(0); // unreachable, damaged() respawns us
+ ceph_abort(); // unreachable, damaged() respawns us
}
}
const bool fatal = cache->mds->damage_table.notify_dirfrag(inode->ino(), frag);
if (fatal) {
cache->mds->damaged();
- assert(0); // unreachable, damaged() respawns us
+ ceph_abort(); // unreachable, damaged() respawns us
}
if (complete)
c.nfiles != fnode.fragstat.nfiles) {
dout(0) << "verify_fragstat failed " << fnode.fragstat << " on " << *this << dendl;
dout(0) << " i count " << c << dendl;
- assert(0);
+ ceph_abort();
} else {
dout(0) << "verify_fragstat ok " << fnode.fragstat << " on " << *this << dendl;
}
if (dir->inode->parent)
dir = dir->inode->parent->dir;
else
- assert(0);
+ ceph_abort();
}
}
} else {
dout(5) << " we lost dentry " << dnkey.name
<< ", bailing out because that's impossible!" << dendl;
- assert(0);
+ ceph_abort();
}
}
// okay, we got a dentry
break;
default:
- assert(0);
+ ceph_abort();
}
}
break;
default:
- assert(0);
+ ceph_abort();
}
}
break;
default:
- assert(0);
+ ceph_abort();
}
}
ename = "lock inest accounted scatter stat update";
break;
default:
- assert(0);
+ ceph_abort();
}
mut->add_projected_fnode(dir);
break;
default:
- assert(0);
+ ceph_abort();
}
}
state_clear(STATE_FROZEN);
put(PIN_FROZEN);
} else
- assert(0);
+ ceph_abort();
take_waiting(WAIT_UNFREEZE, finished);
}
remotes.erase(backtrace_entry->ino);
} else {
derr << "Invalid type " << type << dendl;
- assert(0);
+ ceph_abort();
}
by_id.erase(by_id_entry);
break;
default:
- assert(0);
+ ceph_abort();
}
}
} else {
break;
default:
- assert(0); // implement me
+ ceph_abort(); // implement me
break;
}
}
default:
dout(7) << "get_lock don't know lock_type " << lock_type << dendl;
- assert(0);
+ ceph_abort();
break;
}
default:
dout(7) << "handle_lock got otype " << m->get_lock_type() << dendl;
- assert(0);
+ ceph_abort();
break;
}
}
case LOCK_LOCK: lock->set_state(LOCK_LOCK_SYNC); break;
case LOCK_XSYN: lock->set_state(LOCK_XSYN_SYNC); break;
case LOCK_EXCL: lock->set_state(LOCK_EXCL_SYNC); break;
- default: assert(0);
+ default: ceph_abort();
}
int gather = 0;
case LOCK_LOCK: lock->set_state(LOCK_LOCK_EXCL); break;
case LOCK_SYNC: lock->set_state(LOCK_SYNC_EXCL); break;
case LOCK_XSYN: lock->set_state(LOCK_XSYN_EXCL); break;
- default: assert(0);
+ default: ceph_abort();
}
int gather = 0;
(static_cast<ScatterLock *>(lock))->clear_unscatter_wanted();
break;
case LOCK_TSYN: lock->set_state(LOCK_TSYN_LOCK); break;
- default: assert(0);
+ default: ceph_abort();
}
int gather = 0;
switch (lock->get_state()) {
case LOCK_LOCK:
case LOCK_XLOCKDONE: lock->set_state(LOCK_LOCK_XLOCK); break;
- default: assert(0);
+ default: ceph_abort();
}
int gather = 0;
simple_sync(lock);
break;
default:
- assert(0);
+ ceph_abort();
}
++count;
if (lock->is_stable() && count == 2) {
CInode *in = static_cast<CInode *>(lock->get_parent());
switch (lock->get_state()) {
- case LOCK_SYNC: assert(0); // this shouldn't happen
+ case LOCK_SYNC: ceph_abort(); // this shouldn't happen
case LOCK_LOCK: lock->set_state(LOCK_LOCK_TSYN); break;
case LOCK_MIX: lock->set_state(LOCK_MIX_TSYN); break;
- default: assert(0);
+ default: ceph_abort();
}
int gather = 0;
// fall-thru
case LOCK_EXCL: lock->set_state(LOCK_EXCL_MIX); break;
case LOCK_TSYN: lock->set_state(LOCK_TSYN_MIX); break;
- default: assert(0);
+ default: ceph_abort();
}
int gather = 0;
case LOCK_MIX: lock->set_state(LOCK_MIX_EXCL); break;
case LOCK_LOCK: lock->set_state(LOCK_LOCK_EXCL); break;
case LOCK_XSYN: lock->set_state(LOCK_XSYN_EXCL); break;
- default: assert(0);
+ default: ceph_abort();
}
int gather = 0;
switch (lock->get_state()) {
case LOCK_EXCL: lock->set_state(LOCK_EXCL_XSYN); break;
- default: assert(0);
+ default: ceph_abort();
}
int gather = 0;
switch (lock->get_state()) {
case LOCK_SYNC: lock->set_state(LOCK_SYNC_LOCK); break;
case LOCK_MIX: lock->set_state(LOCK_MIX_LOCK); break;
- default: assert(0);
+ default: ceph_abort();
}
eval_gather(lock, true);
break;
default:
- assert(0);
+ ceph_abort();
}
m->put();
/*** recovery ***/
/* replay() - replay given event. this is idempotent.
*/
- virtual void replay(MDSRank *m) { assert(0); }
+ virtual void replay(MDSRank *m) { ceph_abort(); }
/**
* If the subclass embeds a MetaBlob, return it here so that
return cpu_load_avg;
}
- assert(0);
+ ceph_abort();
return 0;
}
// it is not okay to call suicide() here because we are in
// a Finisher callback.
cache->mds->damaged();
- assert(0); // damaged should never return
+ ceph_abort(); // damaged should never return
} else {
cache->open_root();
}
mds->server->do_rmdir_rollback(su->rollback, from, null_ref);
break;
default:
- assert(0);
+ ceph_abort();
}
} else {
MDRequestRef mdr = request_get(*p);
break;
default:
- assert(0);
+ ceph_abort();
}
m->put();
}
if (MDS_INO_IS_MDSDIR(path.get_ino()))
open_foreign_mdsdir(path.get_ino(), _get_waiter(mdr, req, fin));
else {
- //assert(0); // hrm.. broken
+ //ceph_abort(); // hrm.. broken
return -ESTALE;
}
return 1;
dout(20) << " didn't traverse full path; not returning pdnvec" << dendl;
dn = NULL;
} else if (dn) {
- assert(0); // should have fallen out in ->is_null() check above
+ ceph_abort(); // should have fallen out in ->is_null() check above
} else if (curdir->is_frozen()) {
dout(20) << " not adding null to frozen dir " << dendl;
} else if (snapid < CEPH_MAXSNAP) {
}
}
- assert(0); // i shouldn't get here
+ ceph_abort(); // i shouldn't get here
}
// success.
dn->get_projected_linkage()->get_remote_ino());
if (fatal) {
mds->damaged();
- assert(0); // unreachable, damaged() respawns us
+ ceph_abort(); // unreachable, damaged() respawns us
}
}
fin->complete(r < 0 ? r : 0);
repair_inode_stats_work(mdr);
break;
default:
- assert(0);
+ ceph_abort();
}
}
}
/*
static int count = 5;
if (--count == 0)
- assert(0); // hack test test **********
+ ceph_abort(); // hack test test **********
*/
// done.
::encode(ino, m->bl);
::encode(d_type, m->bl);
} else
- assert(0); // aie, bad caller!
+ ceph_abort(); // aie, bad caller!
mds->send_message_mds(m, p->first);
}
}
dir->link_remote_inode(dn, ino, d_type);
}
} else {
- assert(0);
+ ceph_abort();
}
if (!finished.empty())
if (p->first.frag.contains(dir->get_frag()))
return p->second.all_frozen;
}
- assert(0);
+ ceph_abort();
return false;
}
return;
}
}
- assert(0);
+ ceph_abort();
}
void MDCache::find_stale_fragment_freeze()
mds->queue_waiters(waiters);
} else {
- assert(0);
+ ceph_abort();
}
notify->put();
mds->clog->error() << "Unhandled journal write error on MDS rank " <<
mds->get_nodeid() << ": " << cpp_strerror(r) << ", shutting down.";
mds->damaged();
- assert(0); // damaged should never return
+ ceph_abort(); // damaged should never return
}
}
// Oh dear, something unreadable in the store for this rank: require
// operator intervention.
mds->damaged();
- assert(0); // damaged should not return
+ ceph_abort(); // damaged should not return
}
// First, read the pointer object.
} else if (read_result == -EBLACKLISTED) {
derr << "Blacklisted during JournalPointer read! Respawning..." << dendl;
mds->respawn();
- assert(0); // Should be unreachable because respawn calls execv
+ ceph_abort(); // Should be unreachable because respawn calls execv
} else if (read_result != 0) {
mds->clog->error() << "failed to read JournalPointer: " << read_result
<< " (" << cpp_strerror(read_result) << ")";
mds->damaged_unlocked();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
// If the back pointer is non-null, that means that a journal
if (recovery_result == -EBLACKLISTED) {
derr << "Blacklisted during journal recovery! Respawning..." << dendl;
mds->respawn();
- assert(0); // Should be unreachable because respawn calls execv
+ ceph_abort(); // Should be unreachable because respawn calls execv
} else if (recovery_result != 0) {
// Journaler.recover succeeds if no journal objects are present: an error
// means something worse like a corrupt header, which we can't handle here.
if (recovery_result == -EBLACKLISTED) {
derr << "Blacklisted during journal recovery! Respawning..." << dendl;
mds->respawn();
- assert(0); // Should be unreachable because respawn calls execv
+ ceph_abort(); // Should be unreachable because respawn calls execv
} else if (recovery_result != 0) {
mds->clog->error() << "Error recovering journal " << jp.front << ": "
<< cpp_strerror(recovery_result);
} else {
mds->clog->error() << "missing journal object";
mds->damaged_unlocked();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
} else if (r == -EINVAL) {
if (journaler->get_read_pos() < journaler->get_expire_pos()) {
} else {
mds->clog->error() << "invalid journaler offsets";
mds->damaged_unlocked();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
} else {
/* re-read head and check it
mds->clog->error() << "error reading journal header";
mds->damaged_unlocked();
- assert(0); // Should be unreachable because damaged() calls
+ ceph_abort(); // Should be unreachable because damaged() calls
// respawn()
}
}
continue;
} else {
mds->damaged_unlocked();
- assert(0); // Should be unreachable because damaged() calls
+ ceph_abort(); // Should be unreachable because damaged() calls
// respawn()
}
case PIN_PTRWAITER: return "ptrwaiter";
case PIN_TEMPEXPORTING: return "tempexporting";
case PIN_CLIENTLEASE: return "clientlease";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
#ifdef MDS_REF_SET
assert(by < 0 || ref_map[by] == 0);
#endif
- assert(0);
+ ceph_abort();
}
void get(int by) {
if (ref == 0)
// ---------------------------------------------
// locking
// noop unless overloaded.
- virtual SimpleLock* get_lock(int type) { assert(0); return 0; }
- virtual void set_object_info(MDSCacheObjectInfo &info) { assert(0); }
- virtual void encode_lock_state(int type, bufferlist& bl) { assert(0); }
- virtual void decode_lock_state(int type, bufferlist& bl) { assert(0); }
- virtual void finish_lock_waiters(int type, uint64_t mask, int r=0) { assert(0); }
- virtual void add_lock_waiter(int type, uint64_t mask, MDSInternalContextBase *c) { assert(0); }
- virtual bool is_lock_waiting(int type, uint64_t mask) { assert(0); return false; }
-
- virtual void clear_dirty_scattered(int type) { assert(0); }
+ virtual SimpleLock* get_lock(int type) { ceph_abort(); return 0; }
+ virtual void set_object_info(MDSCacheObjectInfo &info) { ceph_abort(); }
+ virtual void encode_lock_state(int type, bufferlist& bl) { ceph_abort(); }
+ virtual void decode_lock_state(int type, bufferlist& bl) { ceph_abort(); }
+ virtual void finish_lock_waiters(int type, uint64_t mask, int r=0) { ceph_abort(); }
+ virtual void add_lock_waiter(int type, uint64_t mask, MDSInternalContextBase *c) { ceph_abort(); }
+ virtual bool is_lock_waiting(int type, uint64_t mask) { ceph_abort(); return false; }
+
+ virtual void clear_dirty_scattered(int type) { ceph_abort(); }
// ---------------------------------------------
// ordering
MDSRank *MDSInternalContextGather::get_mds()
{
derr << "Forbidden call to MDSInternalContextGather::get_mds by " << typeid(*this).name() << dendl;
- assert(0);
+ ceph_abort();
}
*/
class C_MDSInternalNoop : public MDSInternalContextBase
{
- virtual MDSRank* get_mds() {assert(0);}
+ virtual MDSRank* get_mds() {ceph_abort();}
public:
void finish(int r) {}
void complete(int r) {}
// We have to assert out here, because suicide() returns, and callers
// to respawn expect it never to return.
- assert(0);
+ ceph_abort();
}
switch (t) {
case TABLE_ANCHOR: return NULL;
case TABLE_SNAP: return snapclient;
- default: assert(0);
+ default: ceph_abort();
}
}
switch (t) {
case TABLE_ANCHOR: return NULL;
case TABLE_SNAP: return snapserver;
- default: assert(0);
+ default: ceph_abort();
}
}
virtual void _prepare(bufferlist &bl, uint64_t reqid, mds_rank_t bymds) = 0;
virtual bool _commit(version_t tid, MMDSTableRequest *req=NULL) = 0;
virtual void _rollback(version_t tid) = 0;
- virtual void _server_update(bufferlist& bl) { assert(0); }
+ virtual void _server_update(bufferlist& bl) { ceph_abort(); }
void _note_prepare(mds_rank_t mds, uint64_t reqid) {
pending_for_mds[version].mds = mds;
break;
default:
- assert(0);
+ ceph_abort();
}
// finish clean-up?
}
if (dir->inode->is_system()) {
dout(7) << "i won't export system dirs (root, mdsdirs, stray, /.ceph, etc.)" << dendl;
- //assert(0);
+ //ceph_abort();
return;
}
if (r > 0) return;
if (r < 0) {
dout(7) << "handle_export_discover_2 failed to discover or not dir " << m->get_path() << ", NAK" << dendl;
- assert(0); // this shouldn't happen if the auth pins its path properly!!!!
+ ceph_abort(); // this shouldn't happen if the auth pins its path properly!!!!
}
- assert(0); // this shouldn't happen; the get_inode above would have succeeded.
+ ceph_abort(); // this shouldn't happen; the get_inode above would have succeeded.
}
// yay
case EXPORT_EXPORTING: return "exporting";
case EXPORT_LOGGINGFINISH: return "loggingfinish";
case EXPORT_NOTIFYING: return "notifying";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
case IMPORT_ACKING: return "acking";
case IMPORT_FINISHING: return "finishing";
case IMPORT_ABORTING: return "aborting";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
break;
default:
- assert(0);
+ ceph_abort();
}
m->put();
}
}
mds->sessionmap.remove_session(session);
} else {
- assert(0);
+ ceph_abort();
}
} else {
- assert(0);
+ ceph_abort();
}
}
break;
default:
- assert(0);
+ ceph_abort();
}
// done with reply.
if (!lock) {
dout(10) << "don't have object, dropping" << dendl;
- assert(0); // can this happen, if we auth pinned properly.
+ ceph_abort(); // can this happen, if we auth pinned properly.
}
if (op == MMDSSlaveRequest::OP_XLOCK && !lock->get_parent()->is_auth()) {
dout(10) << "not auth for remote xlock attempt, dropping on "
break;
default:
- assert(0);
+ ceph_abort();
}
}
} else if (CDentry *dn = dynamic_cast<CDentry*>(*p)) {
dir = dn->get_dir();
} else {
- assert(0);
+ ceph_abort();
}
if (dir) {
if (dir->is_freezing_dir())
mds->clog->error() << mdr->client_request->get_source()
<< " specified ino " << useino
<< " but mds." << mds->get_nodeid() << " allocated " << in->inode.ino << "\n";
- //assert(0); // just for now.
+ //ceph_abort(); // just for now.
}
int got = g_conf->mds_client_prealloc_inos - mdr->session->get_num_projected_prealloc_inos();
mdr->auth_pin(targeti);
- //assert(0); // test hack: make sure master can handle a slave that fails to prepare...
+ //ceph_abort(); // test hack: make sure master can handle a slave that fails to prepare...
assert(g_conf->mds_kill_link_at != 5);
// journal it
<< "' " << operation_r << " ("
<< cpp_strerror(operation_r) << ")";
mds->damaged();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
// Decode header
mds->clog->error() << "error reading sessionmap header "
<< header_r << " (" << cpp_strerror(header_r) << ")";
mds->damaged();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
if(header_bl.length() == 0) {
} catch (buffer::error &e) {
mds->clog->error() << "corrupt sessionmap header: " << e.what();
mds->damaged();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
dout(10) << __func__ << " loaded version " << version << dendl;
}
mds->clog->error() << "error reading sessionmap values: "
<< values_r << " (" << cpp_strerror(values_r) << ")";
mds->damaged();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
// Decode session_vals
} catch (buffer::error &e) {
mds->clog->error() << "corrupt sessionmap values: " << e.what();
mds->damaged();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
if (session_vals.size() == g_conf->mds_sessionmap_keys_per_op) {
case CEPH_LOCK_INO: return "ino";
case CEPH_LOCK_IFLOCK: return "iflock";
case CEPH_LOCK_IPOLICY: return "ipolicy";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
case LOCK_SNAP_SYNC: return "snap->sync";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
case CEPH_LOCK_IFLOCK: return 8 +10*SimpleLock::WAIT_BITS;
case CEPH_LOCK_IPOLICY: return 8 +11*SimpleLock::WAIT_BITS;
default:
- assert(0);
+ ceph_abort();
}
}
break;
default:
- assert(0);
+ ceph_abort();
}
//dump();
}
pending_noop.erase(tid);
}
else
- assert(0);
+ ceph_abort();
// bump version.
version++;
}
else
- assert(0);
+ ceph_abort();
// bump version.
version++;
if (0 == new_lock.length) {
if (old_lock->start + old_lock->length == new_lock.start) {
new_lock.start = old_lock->start;
- } else assert(0); /* if there's no end to new_lock, the neighbor
+ } else ceph_abort(); /* if there's no end to new_lock, the neighbor
HAS TO be to left side */
} else if (0 == old_lock->length) {
if (new_lock.start + new_lock.length == old_lock->start) {
new_lock.length = 0;
- } else assert(0); //same as before, but reversed
+ } else ceph_abort(); //same as before, but reversed
} else {
if (old_lock->start + old_lock->length == new_lock.start) {
new_lock.start = old_lock->start;
<< std::dec << " in journal";
mds->clog->error() << oss.str();
mds->damaged();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
}
}
dout(0) << "EMetaBlob.replay missing dir ino " << (*lp).ino << dendl;
mds->clog->error() << "failure replaying journal (EMetaBlob)";
mds->damaged();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
}
default:
mds->clog->error() << "invalid tableserver op in ETableServer";
mds->damaged();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
assert(version == server->get_version());
default:
mds->clog->error() << "invalid op in ESlaveUpdate";
mds->damaged();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
}
break;
default:
- assert(0);
+ ceph_abort();
}
metablob.replay(mds, _segment);
<< dendl;
mds->clog->error() << "failure replaying journal (EImportFinish)";
mds->damaged();
- assert(0); // Should be unreachable because damaged() calls respawn()
+ ceph_abort(); // Should be unreachable because damaged() calls respawn()
}
}
switch (t) {
case TABLE_ANCHOR: return "anchortable";
case TABLE_SNAP: return "snaptable";
- default: assert(0);
+ default: ceph_abort();
}
}
case TABLESERVER_OP_ROLLBACK: return "rollback";
case TABLESERVER_OP_SERVER_UPDATE: return "server_update";
case TABLESERVER_OP_SERVER_READY: return "server_ready";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
case TABLE_OP_CREATE: return "create";
case TABLE_OP_UPDATE: return "update";
case TABLE_OP_DESTROY: return "destroy";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
case OP_WEAK: return "weak";
case OP_STRONG: return "strong";
case OP_ACK: return "ack";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
case OP_ABORT: return "abort";
//case OP_COMMIT: return "commit";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
case OP_ACK: return "ack";
case OP_NAK: return "nak";
case OP_VICTORY: return "victory";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
case OP_COMMIT: return "commit";
case OP_LEASE: return "lease";
case OP_LEASE_ACK: return "lease_ack";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
case OP_SLURP_LATEST: return "slurp_latest";
case OP_DATA: return "data";
case OP_MISSING_FEATURES: return "missing_features";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
}
void encode_payload(uint64_t features) {
- assert(0);
+ ceph_abort();
paxos_encode();
}
void decode_payload() {
- assert(0);
+ ceph_abort();
bufferlist::iterator p = payload.begin();
paxos_decode(p);
}
auto handler = auth_registry.get_handler(protocol);
if (!handler) {
dout(0) << "No AuthAuthorizeHandler found for protocol " << protocol << dendl;
- assert(0);
+ ceph_abort();
is_valid = false;
return true;
}
}
} else if (key.first == CEPH_ENTITY_TYPE_OSD) {
} else {
- assert(0);
+ ceph_abort();
}
} else {
dout(1) << "mon failed to return metadata for "
// from monclient anyway), but we don't see notifications. Hook
// into MonClient to get notifications instead of messing
// with message delivery to achieve it?
- assert(0);
+ ceph_abort();
py_modules.notify_all("mon_map", "");
break;
void PyFormatter::dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap)
{
// TODO
- assert(0);
+ ceph_abort();
}
/**
Py_DECREF(key);
Py_DECREF(p);
} else {
- assert(0);
+ ceph_abort();
}
}
#include <list>
#include "common/Formatter.h"
+#include "include/assert.h"
class PyFormatter : public ceph::Formatter
{
// Obscure, don't care.
void open_array_section_in_ns(const char *name, const char *ns)
- {assert(0);}
+ {ceph_abort();}
void open_object_section_in_ns(const char *name, const char *ns)
- {assert(0);}
+ {ceph_abort();}
void reset()
{
void flush(std::ostream& os)
{
// This class is not a serializer: this doens't make sense
- assert(0);
+ ceph_abort();
}
int get_len() const
{
// This class is not a serializer: this doens't make sense
- assert(0);
+ ceph_abort();
return 0;
}
void write_raw_data(const char *data)
{
// This class is not a serializer: this doens't make sense
- assert(0);
+ ceph_abort();
}
PyObject *get()
auto set_fn = PyObject_GetAttrString(completion, "complete");
if (set_fn == nullptr) {
- assert(0); // TODO raise python exception instead
+ ceph_abort(); // TODO raise python exception instead
} else {
assert(PyCallable_Check(set_fn));
}
return false;
default:
- assert(0);
+ ceph_abort();
return true;
}
}
case CEPH_MSG_AUTH:
return prep_auth(op, true);
default:
- assert(0);
+ ceph_abort();
return false;
}
}
handle_nak(op);
return;
default:
- assert(0);
+ ceph_abort();
}
}
break;
default:
- assert(0);
+ ceph_abort();
}
}
return preprocess_log(op);
default:
- assert(0);
+ ceph_abort();
return true;
}
}
case MSG_LOG:
return prepare_log(op);
default:
- assert(0);
+ ceph_abort();
return false;
}
}
return preprocess_offload_targets(op);
default:
- assert(0);
+ ceph_abort();
return true;
}
}
return prepare_offload_targets(op);
default:
- assert(0);
+ ceph_abort();
}
return true;
break;
default:
derr << __func__ << " unknown op type " << op.type << dendl;
- ceph_assert(0);
+ ceph_abort();
break;
}
}
case MSG_MON_JOIN:
return preprocess_join(op);
default:
- assert(0);
+ ceph_abort();
return true;
}
}
case MSG_MON_JOIN:
return prepare_join(op);
default:
- assert(0);
+ ceph_abort();
}
return false;
return preprocess_remove_snaps(op);
default:
- assert(0);
+ ceph_abort();
return true;
}
}
return prepare_remove_snaps(op);
default:
- assert(0);
+ ceph_abort();
}
return false;
<< bl.length() << " bytes" << dendl;
m->maps[e] = bl;
} else {
- assert(0); // we should have all maps.
+ ceph_abort(); // we should have all maps.
}
}
}
case POOL_OP_AUID_CHANGE:
return false;
default:
- assert(0);
+ ceph_abort();
break;
}
break;
default:
- assert(0);
+ ceph_abort();
break;
}
default:
- assert(0);
+ ceph_abort();
return true;
}
}
return prepare_command(op);
default:
- assert(0);
+ ceph_abort();
return false;
}
}
whatname = "stale";
break;
default:
- assert(0);
+ ceph_abort();
}
ss << "pg " << p->first << " is stuck " << whatname;
if (since == utime_t()) {
else if (is_updating())
state = STATE_WRITING;
else
- assert(0);
+ ceph_abort();
if (mon->get_quorum().size() > 1) {
// cancel timeout event
if (!mon->is_peon()) {
dout(10) << "not a peon, dropping" << dendl;
- assert(0);
+ ceph_abort();
return;
}
handle_lease_ack(op);
break;
default:
- assert(0);
+ ceph_abort();
}
}
break;
default:
- assert(0);
+ ceph_abort();
}
}
case PAXOS_LOG: return "logm";
case PAXOS_AUTH: return "auth";
case PAXOS_MGR: return "mgr";
- default: assert(0); return 0;
+ default: ceph_abort(); return 0;
}
}
msgr->ms_deliver_handle_refused(qitem.get_connection());
break;
default:
- assert(0);
+ ceph_abort();
}
} else {
Message *m = qitem.get_message();
*
* @param m The Message to fast dispatch.
*/
- virtual void ms_fast_dispatch(Message *m) { assert(0); }
+ virtual void ms_fast_dispatch(Message *m) { ceph_abort(); }
/**
* Let the Dispatcher preview a Message before it is dispatched. This
* function is called on *every* Message, prior to the fast/regular dispatch
if (cct) {
ldout(cct, 0) << "can't decode unknown message type " << type << " MSG_AUTH=" << CEPH_MSG_AUTH << dendl;
if (cct->_conf->ms_die_on_bad_msg)
- assert(0);
+ ceph_abort();
}
return 0;
}
<< " because compat_version " << header.compat_version
<< " > supported version " << m->get_header().version << dendl;
if (cct->_conf->ms_die_on_bad_msg)
- assert(0);
+ ceph_abort();
}
m->put();
return 0;
m->get_payload().hexdump(*_dout);
*_dout << dendl;
if (cct->_conf->ms_die_on_bad_msg)
- assert(0);
+ ceph_abort();
}
m->put();
return 0;
return;
}
}
- assert(0);
+ ceph_abort();
}
/**
*
/**
* Deliver a single Message. Send it to each Dispatcher
* in sequence until one of them handles it.
- * If none of our Dispatchers can handle it, assert(0).
+ * If none of our Dispatchers can handle it, ceph_abort().
*
* @param m The Message to deliver. We take ownership of
* one reference to it.
default:
{
lderr(async_msgr->cct) << __func__ << " bad state: " << state << dendl;
- assert(0);
+ ceph_abort();
}
}
existing = NULL;
goto open;
}
- assert(0);
+ ceph_abort();
replace:
ldout(async_msgr->cct, 10) << __func__ << " accept replacing " << existing << dendl;
cs.close();
return ;
} else {
- assert(0);
+ ceph_abort();
}
}
int n = write(notify_send_fd, &buf, sizeof(buf));
if (n < 0) {
ldout(cct, 1) << __func__ << " write notify pipe failed: " << cpp_strerror(errno) << dendl;
- assert(0);
+ ceph_abort();
}
}
u.sin6.sin6_port = htons(port);
break;
default:
- assert(0);
+ ceph_abort();
}
}
int get_port() const {
existing = NULL;
goto open;
}
- assert(0);
+ ceph_abort();
retry_session:
assert(existing->pipe_lock.is_locked());
bool BitMapZone::reserve_blocks(int64_t num_blocks)
{
- alloc_assert(0);
+ ceph_abort();
return false;
}
void BitMapZone::unreserve(int64_t num_blocks, int64_t allocated)
{
- alloc_assert(0);
+ ceph_abort();
}
int64_t BitMapZone::get_reserved_blocks()
{
- alloc_assert(0);
+ ceph_abort();
return 0;
}
int64_t unaligned_blocks = 0;
if (mode != SERIAL && mode != CONCURRENT) {
- alloc_assert(0);
+ ceph_abort();
}
if (total_blocks <= 0) {
- alloc_assert(0);
+ ceph_abort();
}
if (zone_size_block == 0 ||
zone_size_block < BmapEntry::size()) {
- alloc_assert(0);
+ ceph_abort();
}
zone_size_block = (zone_size_block / BmapEntry::size()) *
*start_block = 0;
if (!check_input(num_blocks)) {
- alloc_assert(0);
+ ceph_abort();
return 0;
}
virtual bool is_allocated(int64_t start_block, int64_t num_blocks) = 0;
virtual bool is_exhausted() = 0;
virtual bool child_check_n_lock(BitMapArea *child, int64_t required) {
- alloc_assert(0);
+ ceph_abort();
return true;
}
virtual bool child_check_n_lock(BitMapArea *child, int64_t required, bool lock) {
- alloc_assert(0);
+ ceph_abort();
return true;
}
virtual void child_unlock(BitMapArea *child) {
- alloc_assert(0);
+ ceph_abort();
}
virtual void lock_excl() = 0;
virtual bool lock_excl_try() {
- alloc_assert(0);
+ ceph_abort();
return false;
}
virtual void lock_shared() {
- alloc_assert(0);
+ ceph_abort();
return;
}
virtual void unlock() = 0;
virtual void shutdown() = 0;
virtual int64_t alloc_blocks(bool wait, int64_t num_blocks,
int64_t hint, int64_t *start_block) {
- alloc_assert(0);
+ ceph_abort();
return 0;
}
virtual int64_t alloc_blocks(int64_t num_blocks, int64_t hint, int64_t *start_block) {
- alloc_assert(0);
+ ceph_abort();
return 0;
}
virtual int64_t alloc_blocks_dis(bool wait, int64_t num_blocks,
int64_t hint, int64_t blk_off, ExtentList *block_list) {
- alloc_assert(0);
+ ceph_abort();
return 0;
}
virtual int64_t alloc_blocks_dis(int64_t num_blocks,
int64_t hint, int64_t blk_off, ExtentList *block_list) {
- alloc_assert(0);
+ ceph_abort();
return 0;
}
virtual void set_blocks_used(int64_t start_block, int64_t num_blocks) = 0;
virtual int64_t alloc_blocks(bool wait, int64_t num_blocks,
int64_t hint, int64_t *start_block) {
- alloc_assert(0);
+ ceph_abort();
return 0;
}
virtual int64_t alloc_blocks_dis(bool wait, int64_t num_blocks,
int64_t hint, int64_t blk_off, int64_t *block_list) {
- alloc_assert(0);
+ ceph_abort();
return 0;
}
virtual bool is_exhausted();
bool child_check_n_lock(BitMapArea *child, int64_t required, bool lock) {
- alloc_assert(0);
+ ceph_abort();
return false;
}
BitMapAreaLeaf(int64_t zone_num, int64_t total_blocks, bool def);
bool child_check_n_lock(BitMapArea *child, int64_t required) {
- alloc_assert(0);
+ ceph_abort();
return false;
}
#endif
derr << __func__ << " unknown backend " << type << dendl;
- assert(0);
+ ceph_abort();
return NULL;
}
const std::string& src,
const std::string& target)
{
- assert(0);
+ ceph_abort();
}
rocksdb::Status BlueRocksEnv::LockFile(
if (!oid.match(cnode.bits, pgid.ps())) {
derr << __func__ << " oid " << oid << " not part of " << pgid
<< " bits " << cnode.bits << dendl;
- assert(0);
+ ceph_abort();
}
}
default:
derr << __func__ << "bad op " << op->op << dendl;
- assert(0);
+ ceph_abort();
}
endop:
if (r < 0) {
r = -errno;
derr << __func__ << " fdatasync got: " << cpp_strerror(r) << dendl;
- assert(0);
+ ceph_abort();
}
dout(5) << __func__ << " in " << dur << dendl;;
return r;
<< std::hex
<< offset << "~" << length << std::dec
<< " with " << debug_inflight << dendl;
- assert(0);
+ ceph_abort();
}
debug_inflight.insert(offset, length);
}
{
dout(1) << __func__ << " start" << dendl;
if (spdk_nvme_register_io_thread() != 0) {
- assert(0);
+ ceph_abort();
}
if (data_buf_mempool.empty()) {
t->ctx->nvme_task_first = t->ctx->nvme_task_last = nullptr;
delete t;
derr << __func__ << " failed to do write command" << dendl;
- assert(0);
+ ceph_abort();
}
cur = ceph::coarse_real_clock::now(g_ceph_context);
auto dur = std::chrono::duration_cast<std::chrono::nanoseconds>(cur - start);
ns = spdk_nvme_ctrlr_get_ns(c, 1);
if (!ns) {
derr << __func__ << " failed to get namespace at 1" << dendl;
- assert(0);
+ ceph_abort();
}
dout(1) << __func__ << " successfully attach nvme device at" << name
<< " " << spdk_pci_device_get_bus(pci_dev) << ":" << spdk_pci_device_get_dev(pci_dev) << ":" << spdk_pci_device_get_func(pci_dev) << dendl;
int r = rte_eal_init(sizeof(ealargs) / sizeof(ealargs[0]), (char **)(void *)(uintptr_t)ealargs);
if (r < 0) {
derr << __func__ << " failed to do rte_eal_init" << dendl;
- assert(0);
+ ceph_abort();
}
request_mempool = rte_mempool_create("nvme_request", 512,
SOCKET_ID_ANY, 0);
if (request_mempool == NULL) {
derr << __func__ << " failed to create memory pool for nvme requests" << dendl;
- assert(0);
+ ceph_abort();
}
pci_system_init();
uint32_t match, //< [in] value to match
uint32_t bits, //< [in] bits to check
CollectionIndex* dest //< [in] destination index
- ) { assert(0); return 0; }
+ ) { ceph_abort(); return 0; }
/// List contents of collection by hash
virtual int pre_hash_collection(
uint32_t pg_num, ///< [in] pg number of the pool this collection belongs to
uint64_t expected_num_objs ///< [in] expected number of objects this collection has
- ) { assert(0); return 0; }
+ ) { ceph_abort(); return 0; }
- virtual int apply_layout_settings() { assert(0); return 0; }
+ virtual int apply_layout_settings() { ceph_abort(); return 0; }
/// Virtual destructor
virtual ~CollectionIndex() {}
if (header->parent) {
Header parent = map->lookup_parent(header);
if (!parent) {
- assert(0);
+ ceph_abort();
return -EINVAL;
}
parent_iter = std::make_shared<DBObjectMapIteratorImpl>(map, parent);
<< " for seq " << input->seq << dendl;
int r = db->get(sys_parent_prefix(input), keys, &out);
if (r < 0) {
- assert(0);
+ ceph_abort();
return Header();
}
if (out.empty()) {
- assert(0);
+ ceph_abort();
return Header();
}
int upper_bound(const string &after) { return 0; }
int lower_bound(const string &to) { return 0; }
bool valid() { return false; }
- int next(bool validate=true) { assert(0); return 0; }
- string key() { assert(0); return ""; }
- bufferlist value() { assert(0); return bufferlist(); }
+ int next(bool validate=true) { ceph_abort(); return 0; }
+ string key() { ceph_abort(); return ""; }
+ bufferlist value() { ceph_abort(); return bufferlist(); }
int status() { return 0; }
};
*corrupt = true;
return false;
} else {
- assert(0);
+ ceph_abort();
}
}
0,
h);
if (result == FAILURE || result == MAYBE_CORRUPT)
- assert(0);
+ ceph_abort();
if (seq == wanted_seq) {
if (_pos)
*_pos = pos;
return;
}
}
- assert(0); // not reachable
+ ceph_abort(); // not reachable
}
void FileJournal::corrupt(
new C_JournaledAhead(this, osr, o, ondisk),
osd_op);
} else {
- assert(0);
+ ceph_abort();
}
submit_manager.op_submit_finish(op_num);
utime_t end = ceph_clock_now(g_ceph_context);
default:
derr << "bad op " << op->op << dendl;
- assert(0);
+ ceph_abort();
}
if (r < 0) {
stringstream errstream;
if (g_conf->filestore_debug_omap_check && !object_map->check(errstream)) {
derr << errstream.str() << dendl;
- assert(0);
+ ceph_abort();
}
if (backend->can_checkpoint()) {
lock.Lock();
while (true)
cond.Wait(lock);
- assert(0);
+ ceph_abort();
}
if (m_filestore_journal_writeahead) {
return true;
}
void _dequeue(OpSequencer *o) {
- assert(0);
+ ceph_abort();
}
bool _empty() {
return store->op_queue.empty();
return c - '0';
if (c >= 'A' && c <= 'F')
return c - 'A' + 10;
- assert(0);
+ ceph_abort();
}
/// int value to hex digit
g_conf->filestore_split_multiple, version);
return 0;
}
- default: assert(0);
+ default: ceph_abort();
}
} else {
}
}
}
- assert(0); // Unreachable
+ ceph_abort(); // Unreachable
return 0;
}
*t++ = '_';
break;
}
- default: assert(0);
+ default: ceph_abort();
}
} else {
*t++ = *i;
} catch (RetryException) { \
failed = true; \
} catch (...) { \
- assert(0); \
+ ceph_abort(); \
} \
} \
return -1; \
if (!oid.match(cnode.bits, pgid.ps())) {
derr << __func__ << " oid " << oid << " not part of " << pgid
<< " bits " << cnode.bits << dendl;
- assert(0);
+ ceph_abort();
}
}
default:
derr << "bad op " << op->op << dendl;
- assert(0);
+ ceph_abort();
}
endop:
default:
derr << "bad op " << op->op << dendl;
- assert(0);
+ ceph_abort();
}
if (r < 0) {
// should never be called once complete
case RecoveryOp::COMPLETE:
default: {
- assert(0);
+ ceph_abort();
};
}
}
<< " returned a null pointer and there is no "
<< " way to recover from such an error in this "
<< " context" << dendl;
- assert(0);
+ ceph_abort();
}
return ref;
},
if (i.requires_kraken()) {
derr << __func__ << ": log entry " << i << " requires kraken"
<< " but overwrites are not enabled!" << dendl;
- assert(0);
+ ceph_abort();
}
}
}
return "COMPLETE";
break;
default:
- assert(0);
+ ceph_abort();
return "";
}
}
#ifdef PG_DEBUG_REFS
p->second->dump_live_ids();
#endif
- assert(0);
+ ceph_abort();
}
p->second->unlock();
p->second->put("PGMap");
OSDriver::OSTransaction _t(driver.get_transaction(&t));
int r = mapper.remove_oid(p->hobj, &_t);
if (r != 0 && r != -ENOENT)
- assert(0);
+ ceph_abort();
t.remove(tmp, *p);
if (removed > g_conf->osd_target_transaction_size) {
int r = store->apply_transaction(osr.get(), std::move(t));
if (!createmap->have_pg_pool(id)) {
dout(5) << __func__ << ": the OSDmap does not contain a PG pool with id = "
<< id << dendl;
- assert(0);
+ ceph_abort();
}
PGPool p = PGPool(createmap, id);
createmap->get_pg_type(pgid.pgid) == pg_pool_t::TYPE_ERASURE)
pg = new ReplicatedPG(&service, createmap, pool, pgid);
else
- assert(0);
+ ceph_abort();
return pg;
}
if (r != 0) {
derr << __func__ << ": apply_transaction returned "
<< cpp_strerror(r) << dendl;
- assert(0);
+ ceph_abort();
}
}
}
if (service.splitting(pgid)) {
- assert(0);
+ ceph_abort();
}
// do we need to resurrect a deleting pg?
OSDriver::OSTransaction _t(osdriver->get_transaction(&t));
int r = mapper->remove_oid(i->hobj, &_t);
if (r != 0 && r != -ENOENT) {
- assert(0);
+ ceph_abort();
}
t.remove(coll, *i);
if (++num >= cct->_conf->osd_target_transaction_size) {
MOSDPGUpdateLogMissingReply, MSG_OSD_PG_UPDATE_LOG_MISSING_REPLY>(
op);
default:
- assert(0);
+ ceph_abort();
return 0;
}
}
op, osdmap);
break;
default:
- assert(0);
+ ceph_abort();
}
return true;
}
m->query_epoch,
PG::RemoteReservationRejected()));
} else {
- assert(0);
+ ceph_abort();
}
if (service.splitting(m->pgid)) {
m->query_epoch,
PG::RecoveryDone()));
} else {
- assert(0);
+ ceph_abort();
}
if (service.splitting(m->pgid)) {
return true;
}
void _dequeue(Command *pg) override {
- assert(0);
+ ceph_abort();
}
Command *_dequeue() override {
if (osd->command_queue.empty())
remove_queue.push_front(item);
}
bool _dequeue(pair<PGRef, DeletingStateRef> item) {
- assert(0);
+ ceph_abort();
}
pair<PGRef, DeletingStateRef> _dequeue() override {
assert(!remove_queue.empty());
&_t);
if (!(r == 0 || r == -ENOENT)) {
derr << __func__ << ": remove_oid returned " << cpp_strerror(r) << dendl;
- assert(0);
+ ceph_abort();
}
}
}
&_t);
if (!(r == 0 || r == -ENOENT)) {
derr << __func__ << ": remove_oid returned " << cpp_strerror(r) << dendl;
- assert(0);
+ ceph_abort();
}
snap_mapper.add_oid(
soid,
if (r != 0) {
derr << __func__ << ": apply_transaction returned "
<< cpp_strerror(r) << dendl;
- assert(0);
+ ceph_abort();
}
assert(r == 0);
int r = snap_mapper.get_snaps(hoid, &cur_snaps);
if (r != 0 && r != -ENOENT) {
derr << __func__ << ": get_snaps returned " << cpp_strerror(r) << dendl;
- assert(0);
+ ceph_abort();
}
if (r == -ENOENT || cur_snaps != oi_snaps) {
ObjectStore::Transaction t;
if (r != 0) {
derr << __func__ << ": remove_oid returned " << cpp_strerror(r)
<< dendl;
- assert(0);
+ ceph_abort();
}
osd->clog->error() << "osd." << osd->whoami
<< " found snap mapper error on pg "
break;
default:
- assert(0);
+ ceph_abort();
}
}
}
if (r != 0 && r != -ENOENT) {
derr << __func__ << ": snap_mapper get_next_object_to_trim returned "
<< cpp_strerror(r) << dendl;
- assert(0);
+ ceph_abort();
} else if (r != -ENOENT) {
assert(!hoids.empty());
derr << __func__ << ": snap_mapper get_next_object_to_trim returned "
<< cpp_strerror(r) << " for object "
<< hoids[0] << " on snap " << snap
<< " which should have been fully trimmed " << dendl;
- assert(0);
+ ceph_abort();
}
}
}
cur_epoch,
static_cast<MOSDPGUpdateLogMissingReply*>(op->get_req())->map_epoch);
}
- assert(0);
+ ceph_abort();
return false;
}
PG *pg = context< RecoveryMachine >().pg;
if (pg->info.last_complete != pg->info.last_update) {
- assert(0);
+ ceph_abort();
}
pg->finish_recovery(*context< RecoveryMachine >().get_on_safe_context_list());
pg->mark_clean();
pool.stripe_width);
}
default:
- assert(0);
+ ceph_abort();
return NULL;
}
}
o.stat_error = true;
} else {
derr << __func__ << " got: " << cpp_strerror(r) << dendl;
- assert(0);
+ ceph_abort();
}
}
}
static_cast<MOSDRepOp*>(m), parent->whoami_shard(),
0, get_osdmap()->get_epoch(), CEPH_OSD_FLAG_ACK);
} else {
- assert(0);
+ ceph_abort();
}
// send ack to acker only if we haven't sent a commit already
commit = reply;
}
else {
- assert(0);
+ ceph_abort();
}
commit->set_priority(CEPH_MSG_PRIO_HIGH); // this better match ack priority!
src_obc[clone_oid] = sobc;
continue;
}
- assert(0); // unreachable
+ ceph_abort(); // unreachable
} else {
continue;
}
if (rlatency != utime_t())
osd->logger->tinc(l_osd_op_w_rlat, rlatency);
} else
- assert(0);
+ ceph_abort();
dout(15) << "log_op_stats " << *m
<< " inb " << inb
ObjectContextRef obc = get_object_context(coid, false, NULL);
if (!obc) {
derr << __func__ << " could not find coid " << coid << dendl;
- assert(0);
+ ceph_abort();
}
assert(obc->ssc);
put_snapset_context(ssc);
return 0;
}
- assert(0); //unreachable
+ ceph_abort(); //unreachable
}
dout(10) << "find_object_context " << oid << " @" << oid.snap
break;
default:
- assert(0);
+ ceph_abort();
}
}
++skipped;
break;
default:
- assert(0);
+ ceph_abort();
}
if (started >= max)
break;
if (!recovering.count(soid)) {
derr << __func__ << ": object added to missing set for backfill, but "
<< "is not in recovering, error!" << dendl;
- assert(0);
+ ceph_abort();
}
continue;
}
ObjectMap::ObjectMapIterator iter =
os->get_omap_iterator(cid, hoid);
if (!iter) {
- assert(0);
+ ceph_abort();
return -EINVAL;
}
iter->upper_bound(key);
void cancel() {
canceled = true;
}
- void finish(int) { assert(0); /* not used */ }
+ void finish(int) { ceph_abort(); /* not used */ }
void complete(int) {
dout(10) << "HandleWatchTimeout" << dendl;
boost::intrusive_ptr<ReplicatedPG> pg(watch->pg);
end = write_pos;
ldout(cct, 1) << "_finish_probe_end write_pos = " << end << " (header had "
<< write_pos << "). log was empty. recovered." << dendl;
- assert(0); // hrm.
+ ceph_abort(); // hrm.
} else {
assert(end >= write_pos);
ldout(cct, 1) << "_finish_probe_end write_pos = " << end
// gap
return false;
} else
- assert(0);
+ ceph_abort();
}
return true;
errors[cur] = e;
ldout(oc->cct, 20) << "map_read error " << *e << dendl;
} else {
- assert(0);
+ ceph_abort();
}
loff_t lenfromcur = MIN(e->end() - cur, left);
left -= MIN(left, n->length());
continue; // more?
} else {
- assert(0);
+ ceph_abort();
}
}
return 0;
error += bh->length();
break;
default:
- assert(0);
+ ceph_abort();
}
}
}
objecter->wait_for_latest_osdmap(fin);
} else {
// it doesn't return any other error codes!
- assert(0);
+ ceph_abort();
}
}
};
}
break;
default:
- assert(0);
+ ceph_abort();
break;
}
}
if (ret < 0)
return -ret;
} else { // shouldn't get here
- assert(0);
+ ceph_abort();
}
encode_json("bounds", bounds, formatter);
formatter->flush(cout);
bool _enqueue(RGWAsyncRadosRequest *req);
void _dequeue(RGWAsyncRadosRequest *req) {
- assert(0);
+ ceph_abort();
}
bool _empty();
RGWAsyncRadosRequest *_dequeue();
std::ostream& RGWFormatter_Plain::dump_stream(const char *name)
{
// TODO: implement this!
- assert(0);
+ ceph_abort();
}
void RGWFormatter_Plain::dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap)
break;
default:
- assert(0);
+ ceph_abort();
};
return 0;
}
void _dequeue(RGWRequest* req) {
- assert(0);
+ ceph_abort();
}
bool _empty() {
try {
tx_buffer_it.advance(l);
} catch (buffer::end_of_buffer &e) {
- assert(0);
+ ceph_abort();
}
return l;
string header;
int r = get_header(*object, &header);
if (r < 0) {
- assert(0);
+ ceph_abort();
}
if (header.size() == 0) {
if (hmap.count(*object)) {
break;
}
default: {
- assert(0);
+ ceph_abort();
}
}
ops++;
full_path.c_str(), O_CREAT|O_WRONLY, 0777);
if (fd < 0) {
std::cout << full_path << ": errno is " << errno << std::endl;
- assert(0);
+ ceph_abort();
}
int r = ::lseek(fd, offset, SEEK_SET);
item_queue.push_back(item);
return true;
}
- void _dequeue(write_item*) { assert(0); }
+ void _dequeue(write_item*) { ceph_abort(); }
write_item *_dequeue() {
if (item_queue.empty())
return 0;
q.push_back(item);
return true;
}
- void _dequeue(unsigned *item) { assert(0); }
+ void _dequeue(unsigned *item) { ceph_abort(); }
unsigned *_dequeue() {
if (q.empty())
return 0;
virtual int encode_chunks(const set<int> &want_to_encode,
map<int, bufferlist> *encoded) {
- assert(0);
+ ceph_abort();
return 0;
}
virtual int decode_chunks(const set<int> &want_to_read,
const map<int, bufferlist> &chunks,
map<int, bufferlist> *decoded) {
- assert(0);
+ ceph_abort();
return 0;
}
return true;
}
void _dequeue(Message *m) {
- assert(0);
+ ceph_abort();
}
bool _empty() {
return messages.empty();
cond.Signal();
}
bool ms_dispatch(Message *m) {
- assert(0);
+ ceph_abort();
}
bool ms_handle_reset(Connection *con);
void ms_handle_remote_reset(Connection *con) {
return false;
}
void ms_fast_dispatch(Message *m) {
- assert(0);
+ ceph_abort();
}
bool ms_verify_authorizer(Connection *con, int peer_type, int protocol,
bufferlist& authorizer, bufferlist& authorizer_reply,
}
}
std::cerr << "Verifying " << make_pair(coll, obj) << " failed " << std::endl;
- assert(0);
+ ceph_abort();
}
ObjectContents FileStoreTracker::get_current_content(
++p)
if (available_objects.count(*p) == 0) {
cerr << "+ " << *p << std::endl;
- assert(0);
+ ceph_abort();
}
for (set<ghobject_t>::iterator p = available_objects.begin();
p != available_objects.end();
#include <stdlib.h>
#include <unistd.h>
#include "include/on_exit.h"
+#include "include/assert.h"
#ifndef MAP_ANONYMOUS
# ifdef MAP_ANON
*new_val = EXIT_FUNC_VAL;
exit_func_mgr.add_callback(exit_func_cb, new_val);
call_exit();
- assert(0);
+ ceph_abort();
}
return 0;
void seek(uint64_t _pos) {
if (_pos < pos) {
- assert(0);
+ ceph_abort();
}
while (pos < _pos) {
assert(cur_valid_till >= pos);
int r;
if ((r = comp->get_return_value())) {
cerr << "err " << r << std::endl;
- assert(0);
+ ceph_abort();
}
done = true;
context->update_object_version(oid, comp->get_version64());
if (tid <= last_acked_tid) {
cerr << "Error: finished tid " << tid
<< " when last_acked_tid was " << last_acked_tid << std::endl;
- assert(0);
+ ceph_abort();
}
last_acked_tid = tid;
if (tid <= last_acked_tid) {
cerr << "Error: finished tid " << tid
<< " when last_acked_tid was " << last_acked_tid << std::endl;
- assert(0);
+ ceph_abort();
}
last_acked_tid = tid;
}
if (r && !(r == -ENOENT && !present)) {
cerr << "r is " << r << " while deleting " << oid << " and present is " << present << std::endl;
- assert(0);
+ ceph_abort();
}
context->state_lock.Lock();
int r = context->io_ctx.notify2(context->prefix+oid, bl, 0, NULL);
if (r < 0) {
std::cerr << "r is " << r << std::endl;
- assert(0);
+ ceph_abort();
}
std::cerr << num << ": notified, waiting" << std::endl;
ctx->wait();
if (err != retval) {
cerr << num << ": Error: oid " << oid << " read returned different error codes: "
<< retval << " and " << err << std::endl;
- assert(0);
+ ceph_abort();
}
if (err) {
if (!(err == -ENOENT && old_value.deleted())) {
cerr << num << ": Error: oid " << oid << " read returned error code "
<< err << std::endl;
- assert(0);
+ ceph_abort();
}
} else if (version != old_value.version) {
cerr << num << ": oid " << oid << " version is " << version
}
}
}
- if (context->errors) assert(0);
+ if (context->errors) ceph_abort();
}
// Attributes
int ret = context->io_ctx.snap_create(snapname.c_str());
if (ret) {
cerr << "snap_create returned " << ret << std::endl;
- assert(0);
+ ceph_abort();
}
assert(!context->io_ctx.snap_lookup(snapname.c_str(), &snap));
int r = context->io_ctx.selfmanaged_snap_set_write_ctx(context->seq, snapset);
if (r) {
cerr << "r is " << r << " snapset is " << snapset << " seq is " << context->seq << std::endl;
- assert(0);
+ ceph_abort();
}
}
}
int r = context->io_ctx.selfmanaged_snap_set_write_ctx(context->seq, snapset);
if (r) {
cerr << "r is " << r << " snapset is " << snapset << " seq is " << context->seq << std::endl;
- assert(0);
+ ceph_abort();
}
}
context->state_lock.Unlock();
if (r) {
cerr << "r is " << r << std::endl;
- assert(0);
+ ceph_abort();
}
{
int r;
if ((r = comps[last_finished]->get_return_value()) != 0) {
cerr << "err " << r << std::endl;
- assert(0);
+ ceph_abort();
}
if (--outstanding == 0) {
done = true;
} else {
cerr << "Error: oid " << oid << " copy_from " << oid_src << " returned error code "
<< r << std::endl;
- assert(0);
+ ceph_abort();
}
} else {
assert(!version || comp->get_version64() == version);
default:
cerr << m_op << ": Invalid op type " << type << std::endl;
- assert(0);
+ ceph_abort();
return nullptr;
}
}
dout(0) << "foo started" << dendl;
sleep(1);
dout(0) << "foo asserting 0" << dendl;
- assert(0);
+ ceph_abort();
}
} foo;
if (m.count(pgid)) {
if (m[pgid] != r) {
cout << pgid << " had " << m[pgid] << " now " << r << std::endl;
- assert(0);
+ ceph_abort();
}
} else
m[pgid] = r;
case 0:
return 0;
default:
- assert(0);
+ ceph_abort();
}
string uuid = stringify(sb.cluster_fsid) + "\n";
bufferlist bl;