diff options
Diffstat (limited to 'src/mds')
-rw-r--r-- | src/mds/CDentry.cc | 6 | ||||
-rw-r--r-- | src/mds/CDir.cc | 10 | ||||
-rw-r--r-- | src/mds/CInode.cc | 12 | ||||
-rw-r--r-- | src/mds/DamageTable.cc | 2 | ||||
-rw-r--r-- | src/mds/Locker.cc | 32 | ||||
-rw-r--r-- | src/mds/LogEvent.h | 2 | ||||
-rw-r--r-- | src/mds/MDBalancer.cc | 2 | ||||
-rw-r--r-- | src/mds/MDCache.cc | 28 | ||||
-rw-r--r-- | src/mds/MDLog.cc | 20 | ||||
-rw-r--r-- | src/mds/MDSCacheObject.h | 22 | ||||
-rw-r--r-- | src/mds/MDSContext.cc | 2 | ||||
-rw-r--r-- | src/mds/MDSContext.h | 2 | ||||
-rw-r--r-- | src/mds/MDSDaemon.cc | 2 | ||||
-rw-r--r-- | src/mds/MDSRank.cc | 4 | ||||
-rw-r--r-- | src/mds/MDSTableServer.h | 2 | ||||
-rw-r--r-- | src/mds/Migrator.cc | 8 | ||||
-rw-r--r-- | src/mds/Migrator.h | 4 | ||||
-rw-r--r-- | src/mds/Server.cc | 18 | ||||
-rw-r--r-- | src/mds/SessionMap.cc | 10 | ||||
-rw-r--r-- | src/mds/SimpleLock.h | 6 | ||||
-rw-r--r-- | src/mds/SnapServer.cc | 6 | ||||
-rw-r--r-- | src/mds/flock.cc | 4 | ||||
-rw-r--r-- | src/mds/journal.cc | 12 | ||||
-rw-r--r-- | src/mds/mds_table_types.h | 6 |
24 files changed, 111 insertions, 111 deletions
diff --git a/src/mds/CDentry.cc b/src/mds/CDentry.cc index 2b953a03c34..d2130111f1d 100644 --- a/src/mds/CDentry.cc +++ b/src/mds/CDentry.cc @@ -446,7 +446,7 @@ void CDentry::encode_lock_state(int type, bufferlist& bl) else if (linkage.is_null()) { // encode nothing. } - else assert(0); + else ceph_abort(); } void CDentry::decode_lock_state(int type, bufferlist& bl) @@ -487,7 +487,7 @@ void CDentry::decode_lock_state(int type, bufferlist& bl) } break; default: - assert(0); + ceph_abort(); } } @@ -620,6 +620,6 @@ std::string CDentry::linkage_t::get_remote_d_type_string() const case S_IFDIR: return "dir"; case S_IFCHR: return "chr"; case S_IFIFO: return "fifo"; - default: assert(0); return ""; + default: ceph_abort(); return ""; } } diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 9d20d16de6f..20bbbe547c1 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -1891,7 +1891,7 @@ void CDir::go_bad_dentry(snapid_t last, const std::string &dname) inode->ino(), frag, last, dname); if (fatal) { cache->mds->damaged(); - assert(0); // unreachable, damaged() respawns us + ceph_abort(); // unreachable, damaged() respawns us } } @@ -1900,7 +1900,7 @@ void CDir::go_bad(bool complete) 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) @@ -2616,7 +2616,7 @@ void CDir::verify_fragstat() 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; } @@ -2736,7 +2736,7 @@ CDir *CDir::get_frozen_tree_root() if (dir->inode->parent) dir = dir->inode->parent->dir; else - assert(0); + ceph_abort(); } } @@ -2995,7 +2995,7 @@ int CDir::_next_dentry_on_set(set<dentry_key_t>& dns, bool missing_okay, } else { dout(5) << " we lost dentry " << dnkey.name << ", bailing out because that's impossible!" << dendl; - assert(0); + ceph_abort(); } } // okay, we got a dentry diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 6bf463fc2c9..ef7e89f888a 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -1539,7 +1539,7 @@ void CInode::encode_lock_state(int type, bufferlist& bl) break; default: - assert(0); + ceph_abort(); } } @@ -1793,7 +1793,7 @@ void CInode::decode_lock_state(int type, bufferlist& bl) break; default: - assert(0); + ceph_abort(); } } @@ -1830,7 +1830,7 @@ void CInode::clear_dirty_scattered(int type) break; default: - assert(0); + ceph_abort(); } } @@ -1923,7 +1923,7 @@ void CInode::finish_scatter_update(ScatterLock *lock, CDir *dir, ename = "lock inest accounted scatter stat update"; break; default: - assert(0); + ceph_abort(); } mut->add_projected_fnode(dir); @@ -2185,7 +2185,7 @@ void CInode::finish_scatter_gather_update(int type) break; default: - assert(0); + ceph_abort(); } } @@ -2331,7 +2331,7 @@ void CInode::unfreeze_inode(list<MDSInternalContextBase*>& finished) state_clear(STATE_FROZEN); put(PIN_FROZEN); } else - assert(0); + ceph_abort(); take_waiting(WAIT_UNFREEZE, finished); } diff --git a/src/mds/DamageTable.cc b/src/mds/DamageTable.cc index 57e788b8a1d..58aa0e4ba93 100644 --- a/src/mds/DamageTable.cc +++ b/src/mds/DamageTable.cc @@ -264,7 +264,7 @@ void DamageTable::erase(damage_entry_id_t damage_id) remotes.erase(backtrace_entry->ino); } else { derr << "Invalid type " << type << dendl; - assert(0); + ceph_abort(); } by_id.erase(by_id_entry); diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 3eff5ebd3e6..5963e19e14d 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -831,7 +831,7 @@ void Locker::eval_gather(SimpleLock *lock, bool first, bool *pneed_issue, list<M break; default: - assert(0); + ceph_abort(); } } } else { @@ -3535,7 +3535,7 @@ void Locker::handle_client_lease(MClientLease *m) break; default: - assert(0); // implement me + ceph_abort(); // implement me break; } } @@ -3660,7 +3660,7 @@ SimpleLock *Locker::get_lock(int lock_type, MDSCacheObjectInfo &info) default: dout(7) << "get_lock don't know lock_type " << lock_type << dendl; - assert(0); + ceph_abort(); break; } @@ -3702,7 +3702,7 @@ void Locker::handle_lock(MLock *m) default: dout(7) << "handle_lock got otype " << m->get_lock_type() << dendl; - assert(0); + ceph_abort(); break; } } @@ -3913,7 +3913,7 @@ bool Locker::simple_sync(SimpleLock *lock, bool *need_issue) 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; @@ -3991,7 +3991,7 @@ void Locker::simple_excl(SimpleLock *lock, bool *need_issue) 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; @@ -4057,7 +4057,7 @@ void Locker::simple_lock(SimpleLock *lock, bool *need_issue) (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; @@ -4139,7 +4139,7 @@ void Locker::simple_xlock(SimpleLock *lock) 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; @@ -4436,7 +4436,7 @@ void Locker::scatter_nudge(ScatterLock *lock, MDSInternalContextBase *c, bool fo simple_sync(lock); break; default: - assert(0); + ceph_abort(); } ++count; if (lock->is_stable() && count == 2) { @@ -4511,10 +4511,10 @@ void Locker::scatter_tempsync(ScatterLock *lock, bool *need_issue) 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; @@ -4781,7 +4781,7 @@ void Locker::scatter_mix(ScatterLock *lock, bool *need_issue) // 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; @@ -4855,7 +4855,7 @@ void Locker::file_excl(ScatterLock *lock, bool *need_issue) 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; @@ -4912,7 +4912,7 @@ void Locker::file_xsyn(SimpleLock *lock, bool *need_issue) switch (lock->get_state()) { case LOCK_EXCL: lock->set_state(LOCK_EXCL_XSYN); break; - default: assert(0); + default: ceph_abort(); } int gather = 0; @@ -5027,7 +5027,7 @@ void Locker::handle_file_lock(ScatterLock *lock, MLock *m) 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); @@ -5183,7 +5183,7 @@ void Locker::handle_file_lock(ScatterLock *lock, MLock *m) break; default: - assert(0); + ceph_abort(); } m->put(); diff --git a/src/mds/LogEvent.h b/src/mds/LogEvent.h index ecea57ca3ce..29598503d02 100644 --- a/src/mds/LogEvent.h +++ b/src/mds/LogEvent.h @@ -109,7 +109,7 @@ public: /*** 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 diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index d8a0b5657a7..0593fa91885 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -137,7 +137,7 @@ double mds_load_t::mds_load() return cpu_load_avg; } - assert(0); + ceph_abort(); return 0; } diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 06e7520b865..479e1ea47f0 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -584,7 +584,7 @@ struct C_MDS_RetryOpenRoot : public MDSInternalContext { // 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(); } @@ -3401,7 +3401,7 @@ void MDCache::handle_resolve_ack(MMDSResolveAck *ack) mds->server->do_rmdir_rollback(su->rollback, from, null_ref); break; default: - assert(0); + ceph_abort(); } } else { MDRequestRef mdr = request_get(*p); @@ -4253,7 +4253,7 @@ void MDCache::handle_cache_rejoin(MMDSCacheRejoin *m) break; default: - assert(0); + ceph_abort(); } m->put(); } @@ -7774,7 +7774,7 @@ int MDCache::path_traverse(MDRequestRef& mdr, Message *req, MDSInternalContextBa 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; @@ -7981,7 +7981,7 @@ int MDCache::path_traverse(MDRequestRef& mdr, Message *req, MDSInternalContextBa 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) { @@ -8058,7 +8058,7 @@ int MDCache::path_traverse(MDRequestRef& mdr, Message *req, MDSInternalContextBa } } - assert(0); // i shouldn't get here + ceph_abort(); // i shouldn't get here } // success. @@ -8195,7 +8195,7 @@ void MDCache::_open_remote_dentry_finish(CDentry *dn, inodeno_t ino, MDSInternal 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); @@ -8999,7 +8999,7 @@ void MDCache::dispatch_request(MDRequestRef& mdr) repair_inode_stats_work(mdr); break; default: - assert(0); + ceph_abort(); } } } @@ -9310,7 +9310,7 @@ void MDCache::_snaprealm_create_finish(MDRequestRef& mdr, MutationRef& mut, CIno /* static int count = 5; if (--count == 0) - assert(0); // hack test test ********** + ceph_abort(); // hack test test ********** */ // done. @@ -10290,7 +10290,7 @@ void MDCache::send_dentry_link(CDentry *dn, MDRequestRef& mdr) ::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); } } @@ -10331,7 +10331,7 @@ void MDCache::handle_dentry_link(MDentryLink *m) dir->link_remote_inode(dn, ino, d_type); } } else { - assert(0); + ceph_abort(); } if (!finished.empty()) @@ -10904,7 +10904,7 @@ bool MDCache::fragment_are_all_frozen(CDir *dir) if (p->first.frag.contains(dir->get_frag())) return p->second.all_frozen; } - assert(0); + ceph_abort(); return false; } @@ -10919,7 +10919,7 @@ void MDCache::fragment_freeze_inc_num_waiters(CDir *dir) return; } } - assert(0); + ceph_abort(); } void MDCache::find_stale_fragment_freeze() @@ -11334,7 +11334,7 @@ void MDCache::handle_fragment_notify(MMDSFragmentNotify *notify) mds->queue_waiters(waiters); } else { - assert(0); + ceph_abort(); } notify->put(); diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index 351fad0de75..972b9612d92 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -107,7 +107,7 @@ class C_MDL_WriteError : public MDSIOContextBase { 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 } } @@ -910,7 +910,7 @@ void MDLog::_recovery_thread(MDSInternalContextBase *completion) // 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. @@ -927,12 +927,12 @@ void MDLog::_recovery_thread(MDSInternalContextBase *completion) } 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 @@ -961,7 +961,7 @@ void MDLog::_recovery_thread(MDSInternalContextBase *completion) 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. @@ -1008,7 +1008,7 @@ void MDLog::_recovery_thread(MDSInternalContextBase *completion) 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); @@ -1279,7 +1279,7 @@ void MDLog::_replay_thread() } 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()) { @@ -1290,7 +1290,7 @@ void MDLog::_replay_thread() } 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 @@ -1313,7 +1313,7 @@ void MDLog::_replay_thread() 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() } } @@ -1357,7 +1357,7 @@ void MDLog::_replay_thread() continue; } else { mds->damaged_unlocked(); - assert(0); // Should be unreachable because damaged() calls + ceph_abort(); // Should be unreachable because damaged() calls // respawn() } diff --git a/src/mds/MDSCacheObject.h b/src/mds/MDSCacheObject.h index d9f4c57543d..97e1d9a6098 100644 --- a/src/mds/MDSCacheObject.h +++ b/src/mds/MDSCacheObject.h @@ -79,7 +79,7 @@ class MDSCacheObject { 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; } } @@ -195,7 +195,7 @@ protected: #ifdef MDS_REF_SET assert(by < 0 || ref_map[by] == 0); #endif - assert(0); + ceph_abort(); } void get(int by) { if (ref == 0) @@ -378,15 +378,15 @@ protected: // --------------------------------------------- // 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 diff --git a/src/mds/MDSContext.cc b/src/mds/MDSContext.cc index 607031020c8..4188d8166ac 100644 --- a/src/mds/MDSContext.cc +++ b/src/mds/MDSContext.cc @@ -100,6 +100,6 @@ void C_IO_Wrapper::complete(int r) MDSRank *MDSInternalContextGather::get_mds() { derr << "Forbidden call to MDSInternalContextGather::get_mds by " << typeid(*this).name() << dendl; - assert(0); + ceph_abort(); } diff --git a/src/mds/MDSContext.h b/src/mds/MDSContext.h index 1f46510b86f..e021906463a 100644 --- a/src/mds/MDSContext.h +++ b/src/mds/MDSContext.h @@ -133,7 +133,7 @@ public: */ 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) {} diff --git a/src/mds/MDSDaemon.cc b/src/mds/MDSDaemon.cc index eb1d944bf47..d9c60fb986a 100644 --- a/src/mds/MDSDaemon.cc +++ b/src/mds/MDSDaemon.cc @@ -1141,7 +1141,7 @@ void MDSDaemon::respawn() // We have to assert out here, because suicide() returns, and callers // to respawn expect it never to return. - assert(0); + ceph_abort(); } diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index a1d6a395445..41ad61406f3 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -299,7 +299,7 @@ MDSTableClient *MDSRank::get_table_client(int t) switch (t) { case TABLE_ANCHOR: return NULL; case TABLE_SNAP: return snapclient; - default: assert(0); + default: ceph_abort(); } } @@ -308,7 +308,7 @@ MDSTableServer *MDSRank::get_table_server(int t) switch (t) { case TABLE_ANCHOR: return NULL; case TABLE_SNAP: return snapserver; - default: assert(0); + default: ceph_abort(); } } diff --git a/src/mds/MDSTableServer.h b/src/mds/MDSTableServer.h index d103d3e3784..ee569392cb4 100644 --- a/src/mds/MDSTableServer.h +++ b/src/mds/MDSTableServer.h @@ -42,7 +42,7 @@ private: 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; diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index bb727300cbe..c1a705d8696 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -340,7 +340,7 @@ void Migrator::export_try_cancel(CDir *dir, bool notify_peer) break; default: - assert(0); + ceph_abort(); } // finish clean-up? @@ -753,7 +753,7 @@ void Migrator::export_dir(CDir *dir, mds_rank_t dest) } if (dir->inode->is_system()) { dout(7) << "i won't export system dirs (root, mdsdirs, stray, /.ceph, etc.)" << dendl; - //assert(0); + //ceph_abort(); return; } @@ -1923,10 +1923,10 @@ void Migrator::handle_export_discover(MExportDirDiscover *m) 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 diff --git a/src/mds/Migrator.h b/src/mds/Migrator.h index 2d14bd95ceb..7ef984441ca 100644 --- a/src/mds/Migrator.h +++ b/src/mds/Migrator.h @@ -76,7 +76,7 @@ public: 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; } } @@ -125,7 +125,7 @@ public: 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; } } diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 86b3013eb2f..e94bd92d5a4 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -390,7 +390,7 @@ void Server::handle_client_session(MClientSession *m) break; default: - assert(0); + ceph_abort(); } m->put(); } @@ -492,10 +492,10 @@ void Server::_session_logged(Session *session, uint64_t state_seq, bool open, ve } mds->sessionmap.remove_session(session); } else { - assert(0); + ceph_abort(); } } else { - assert(0); + ceph_abort(); } } @@ -1802,7 +1802,7 @@ void Server::handle_slave_request_reply(MMDSSlaveRequest *m) break; default: - assert(0); + ceph_abort(); } // done with reply. @@ -1833,7 +1833,7 @@ void Server::dispatch_slave_request(MDRequestRef& mdr) 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 " @@ -1928,7 +1928,7 @@ void Server::dispatch_slave_request(MDRequestRef& mdr) break; default: - assert(0); + ceph_abort(); } } @@ -1996,7 +1996,7 @@ void Server::handle_slave_auth_pin(MDRequestRef& mdr) } else if (CDentry *dn = dynamic_cast<CDentry*>(*p)) { dir = dn->get_dir(); } else { - assert(0); + ceph_abort(); } if (dir) { if (dir->is_freezing_dir()) @@ -2309,7 +2309,7 @@ CInode* Server::prepare_new_inode(MDRequestRef& mdr, CDir *dir, inodeno_t useino 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(); @@ -5175,7 +5175,7 @@ void Server::handle_slave_link_prep(MDRequestRef& mdr) 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 diff --git a/src/mds/SessionMap.cc b/src/mds/SessionMap.cc index ddbefad46c0..bc4a6a522d4 100644 --- a/src/mds/SessionMap.cc +++ b/src/mds/SessionMap.cc @@ -162,7 +162,7 @@ void SessionMap::_load_finish( << "' " << 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 @@ -172,7 +172,7 @@ void SessionMap::_load_finish( 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) { @@ -186,7 +186,7 @@ void SessionMap::_load_finish( } 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; } @@ -197,7 +197,7 @@ void SessionMap::_load_finish( 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 @@ -206,7 +206,7 @@ void SessionMap::_load_finish( } 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) { diff --git a/src/mds/SimpleLock.h b/src/mds/SimpleLock.h index 736fab5cb4c..fd283c82b17 100644 --- a/src/mds/SimpleLock.h +++ b/src/mds/SimpleLock.h @@ -37,7 +37,7 @@ inline const char *get_lock_type_name(int t) { 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; } } @@ -140,7 +140,7 @@ public: case LOCK_SNAP_SYNC: return "snap->sync"; - default: assert(0); return 0; + default: ceph_abort(); return 0; } } @@ -257,7 +257,7 @@ public: 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(); } } diff --git a/src/mds/SnapServer.cc b/src/mds/SnapServer.cc index 7ac888aca00..8ffc4258949 100644 --- a/src/mds/SnapServer.cc +++ b/src/mds/SnapServer.cc @@ -131,7 +131,7 @@ void SnapServer::_prepare(bufferlist &bl, uint64_t reqid, mds_rank_t bymds) break; default: - assert(0); + ceph_abort(); } //dump(); } @@ -179,7 +179,7 @@ bool SnapServer::_commit(version_t tid, MMDSTableRequest *req) pending_noop.erase(tid); } else - assert(0); + ceph_abort(); // bump version. version++; @@ -211,7 +211,7 @@ void SnapServer::_rollback(version_t tid) } else - assert(0); + ceph_abort(); // bump version. version++; diff --git a/src/mds/flock.cc b/src/mds/flock.cc index dc96d772bc1..73c91801308 100644 --- a/src/mds/flock.cc +++ b/src/mds/flock.cc @@ -442,12 +442,12 @@ void ceph_lock_state_t::adjust_locks(list<multimap<uint64_t, ceph_filelock>::ite 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; diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 6314ba8a2c6..c0c6e93e5b3 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -599,7 +599,7 @@ void EMetaBlob::fullbit::update_inode(MDSRank *mds, CInode *in) << 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() } } } @@ -1215,7 +1215,7 @@ void EMetaBlob::replay(MDSRank *mds, LogSegment *logseg, MDSlaveUpdate *slaveup) 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() } } @@ -1961,7 +1961,7 @@ void ETableServer::replay(MDSRank *mds) 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()); @@ -2527,7 +2527,7 @@ void ESlaveUpdate::replay(MDSRank *mds) 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() } } @@ -2770,7 +2770,7 @@ void EFragment::replay(MDSRank *mds) break; default: - assert(0); + ceph_abort(); } metablob.replay(mds, _segment); @@ -3031,7 +3031,7 @@ void EImportFinish::replay(MDSRank *mds) << 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() } } diff --git a/src/mds/mds_table_types.h b/src/mds/mds_table_types.h index dbcd1429bce..4003068bfd3 100644 --- a/src/mds/mds_table_types.h +++ b/src/mds/mds_table_types.h @@ -26,7 +26,7 @@ inline const char *get_mdstable_name(int t) { switch (t) { case TABLE_ANCHOR: return "anchortable"; case TABLE_SNAP: return "snaptable"; - default: assert(0); + default: ceph_abort(); } } @@ -53,7 +53,7 @@ inline const char *get_mdstableserver_opname(int op) { 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; } } @@ -68,7 +68,7 @@ inline const char *get_mdstable_opname(int op) { 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; } } |