]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cleanup: Replace always-false assertions with abort 23718/head
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 23 Aug 2018 20:27:11 +0000 (16:27 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 27 Aug 2018 14:27:22 +0000 (10:27 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
102 files changed:
src/auth/cephx/CephxProtocol.cc
src/client/Client.cc
src/client/Delegation.cc
src/client/fuse_ll.cc
src/common/Cycles.cc
src/common/HeartbeatMap.cc
src/common/Thread.cc
src/common/assert.cc
src/common/ceph_context.cc
src/common/dout.h
src/common/perf_histogram.h
src/crimson/net/SocketConnection.cc
src/crush/CrushWrapper.cc
src/erasure-code/ErasureCode.cc
src/include/mempool.h
src/key_value_store/kv_flat_btree_async.cc
src/kv/KeyValueDB.h
src/kv/KineticStore.cc
src/kv/LevelDBStore.cc
src/kv/MemDB.cc
src/librbd/io/ObjectDispatchSpec.cc
src/librbd/io/ObjectRequest.h
src/librbd/operation/MigrateRequest.h
src/mds/Locker.cc
src/mds/MDBalancer.cc
src/mds/MDCache.cc
src/mds/MDSTableClient.cc
src/mds/MDSTableServer.cc
src/mds/Migrator.cc
src/mds/OpenFileTable.cc
src/mds/Server.cc
src/mds/SessionMap.cc
src/mds/SnapServer.h
src/mds/StrayManager.cc
src/mds/journal.cc
src/messages/MMonQuorumService.h
src/messages/MMonScrub.h
src/messages/MMonSync.h
src/mgr/DaemonServer.cc
src/mgr/PyModule.cc
src/mgr/PyOSDMap.cc
src/mon/Monitor.cc
src/mon/Monitor.h
src/mon/MonitorDBStore.h
src/mon/MonmapMonitor.cc
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h
src/mon/PGMap.cc
src/mon/PaxosService.cc
src/mon/PaxosService.h
src/msg/Messenger.h
src/msg/async/AsyncConnection.cc
src/msg/async/Event.cc
src/msg/async/rdma/RDMAIWARPConnectedSocketImpl.cc
src/msg/simple/Pipe.cc
src/os/ObjectStore.h
src/os/bluestore/BitmapFreelistManager.cc
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueRocksEnv.cc
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h
src/os/bluestore/KernelDevice.cc
src/os/bluestore/bluestore_types.cc
src/os/bluestore/bluestore_types.h
src/os/filestore/FileJournal.cc
src/os/filestore/FileStore.cc
src/os/filestore/JournalingObjectStore.cc
src/os/filestore/WBThrottle.cc
src/os/filestore/chain_xattr.cc
src/os/fs/FS.cc
src/os/kstore/KStore.cc
src/os/memstore/MemStore.cc
src/osd/ECBackend.cc
src/osd/OSD.cc
src/osd/OSDMap.cc
src/osd/PG.cc
src/osd/PGLog.h
src/osd/PGTransaction.h
src/osd/PrimaryLogPG.cc
src/osd/ReplicatedBackend.cc
src/osd/TierAgentState.h
src/osd/osd_internal_types.h
src/osd/osd_types.cc
src/osd/osd_types.h
src/osdc/Journaler.cc
src/osdc/ObjectCacher.cc
src/perf_histogram.h
src/test/admin_socket_output.cc
src/test/compressor/test_compression.cc
src/test/libcephfs/deleg.cc
src/test/librbd/test_mock_ManagedLock.cc
src/test/mon/test_mon_workloadgen.cc
src/test/msgr/test_msgr.cc
src/test/objectstore/DeterministicOpSequence.cc
src/test/objectstore/TestObjectStoreState.cc
src/test/objectstore/store_test.cc
src/test/osd/RadosModel.h
src/test/rbd_mirror/image_map/test_Policy.cc
src/test/signals.cc
src/tools/rbd/action/Device.cc
src/tools/rbd_mirror/ImageMap.cc
src/tools/rbd_mirror/image_map/Types.h

index d815a98c3835f87123ee892b687b36d2c889dd34..58cc26f3d73efb36bb664be7132d0ab7cf0bd3d1 100644 (file)
@@ -429,7 +429,7 @@ bool cephx_verify_authorizer(CephContext *cct, KeyStore *keys,
       ldout(cct, 0) << "verify_authorizer could not get service secret for service "
              << ceph_entity_type_name(service_id) << " secret_id=" << ticket.secret_id << dendl;
       if (cct->_conf->auth_debug && ticket.secret_id == 0)
-       ceph_assert(0 == "got secret_id=0");
+       ceph_abort_msg("got secret_id=0");
       return false;
     }
   }
index fd420acef4e5b17e10e9007dee528f2e20e2265c..e8b83e10eb729dff4b60654949519b1f1faeb132 100644 (file)
@@ -156,7 +156,7 @@ bool Client::CommandHook::call(std::string_view command,
   else if (command == "status")
     m_client->dump_status(f.get());
   else
-    ceph_assert(0 == "bad command registered");
+    ceph_abort_msg("bad command registered");
   m_client->client_lock.Unlock();
   f->close_section();
   f->flush(out);
@@ -1185,7 +1185,7 @@ void Client::insert_readdir_results(MetaRequest *request, MetaSession *session,
          else
            dir->readdir_cache[dirp->cache_index] = dn;
        } else {
-         ceph_assert(0 == "unexpected readdir buffer idx");
+         ceph_abort_msg("unexpected readdir buffer idx");
        }
        dirp->cache_index++;
       }
@@ -1299,7 +1299,7 @@ Inode* Client::insert_trace(MetaRequest *request, MetaSession *session)
 
       if ((wanted & CEPH_CAP_XATTR_SHARED) &&
          !(ist.xattr_version > 0 && ist.xattrbl.length() > 0))
-         ceph_assert(0 == "MDS reply does not contain xattrs");
+       ceph_abort_msg("MDS reply does not contain xattrs");
     }
 
     in = add_update_inode(&ist, request->sent_stamp, session,
@@ -1580,7 +1580,7 @@ int Client::verify_reply_trace(int r,
                         &target, perms);
        } else {
          // if the dentry is not linked, just do our best. see #5021.
-         ceph_assert(0 == "how did this happen?  i want logs!");
+         ceph_abort_msg("how did this happen?  i want logs!");
        }
       } else {
        Inode *in = request->inode();
index 4761d9882c53d2c8d2204029c06f410d85f06c96..58d8aaf9d089ad3a2c4b98b7ed33603da9e982c3 100644 (file)
@@ -57,7 +57,7 @@ int ceph_deleg_caps_for_type(unsigned type)
                break;
        default:
                // Should never happen
-               ceph_assert(false);
+               ceph_abort();
        }
        return caps;
 }
index de5950810b9a88e7bde2fd4ec37a2da141cdaf72..b112ec7488ce8038c5f86b83e63c42e92772c3b9 100644 (file)
@@ -1280,7 +1280,7 @@ uint64_t CephFuse::Handle::make_fake_ino(inodeno_t ino, snapid_t snapid)
       }
     }
     if (stag == first)
-      ceph_assert(0 == "run out of stag");
+      ceph_abort_msg("run out of stag");
 
     inodeno_t fino = MAKE_FINO(ino, stag);
     //cout << "make_fake_ino " << ino << "." << snapid << " -> " << fino << std::endl;
index 2d3e6ba7e7884574e1fd3b9f1b4dcb7eb4805f70..2ebd246990532b7116adf6f7564e5dbd33ca04c4 100644 (file)
@@ -67,12 +67,12 @@ void Cycles::init()
   old_cycles = 0;
   while (1) {
     if (gettimeofday(&start_time, NULL) != 0) {
-      ceph_assert(0 == "couldn't read clock");
+      ceph_abort_msg("couldn't read clock");
     }
     uint64_t start_cycles = rdtsc();
     while (1) {
       if (gettimeofday(&stop_time, NULL) != 0) {
-        ceph_assert(0 == "couldn't read clock");
+        ceph_abort_msg("couldn't read clock");
       }
       uint64_t stop_cycles = rdtsc();
       micros = (stop_time.tv_usec - start_time.tv_usec) +
index a6ca11dee382a2bf45b06674b5e39a3686239db3..222e0b41bab4bbf35bf968b23200aa2a24aa42f9 100644 (file)
@@ -79,7 +79,7 @@ bool HeartbeatMap::_check(const heartbeat_handle_d *h, const char *who,
                    << " had suicide timed out after " << h->suicide_grace << dendl;
     pthread_kill(h->thread_id, SIGABRT);
     sleep(1);
-    ceph_assert(0 == "hit suicide timeout");
+    ceph_abort_msg("hit suicide timeout");
   }
   return healthy;
 }
index f8362a9a8dfb60f2565cd0340651d9f91e89f936..b9e13dc93d5f47b28daedaf46e75c69c84088cfa 100644 (file)
@@ -157,7 +157,7 @@ void Thread::create(const char *name, size_t stacksize)
 int Thread::join(void **prval)
 {
   if (thread_id == 0) {
-    ceph_assert("join on thread that was never started" == 0);
+    ceph_abort_msg("join on thread that was never started");
     return -EINVAL;
   }
 
index 239bd6db0afc14633834dc04132fac6856af30b8..2803e0b7305bc652164d80b1240ceb6d3af72689 100644 (file)
@@ -163,11 +163,11 @@ namespace ceph {
     ostringstream tss;
     tss << ceph_clock_now();
 
+    char buf[8096];
     BackTrace *bt = new BackTrace(1);
-    ba.printf("%s: In function '%s' thread %llx time %s\n"
-             "%s: %d: abort()\n",
-             file, func, (unsigned long long)pthread_self(), tss.str().c_str(),
-             file, line);
+    snprintf(buf, sizeof(buf), "%s: In function '%s' thread %llx time %s\n"
+            "%s: %d: abort()\n", file, func, (unsigned long long)pthread_self(),
+            tss.str().c_str(), file, line);
     dout_emergency(msg);
 
     // TODO: get rid of this memory allocation.
index 861e78dc51f9ce13447ea4bb91129407220f1835..2e633fbed74df5435dde5e952ebc872e5514f10a 100644 (file)
@@ -393,11 +393,9 @@ void CephContext::do_command(std::string_view command, const cmdmap_t& cmdmap,
   }
   lgeneric_dout(this, 1) << "do_command '" << command << "' '"
                         << ss.str() << dendl;
-  if (command == "assert" && _conf->debug_asok_assert_abort) {
-    ceph_assert(0 == "assert");
-  }
+  ceph_assert_always(!(command == "assert" && _conf->debug_asok_assert_abort));
   if (command == "abort" && _conf->debug_asok_assert_abort) {
-    ceph_abort();
+   ceph_abort();
   }
   if (command == "perfcounters_dump" || command == "1" ||
       command == "perf dump") {
@@ -534,7 +532,7 @@ void CephContext::do_command(std::string_view command, const cmdmap_t& cmdmap,
       _log->reopen_log_file();
     }
     else {
-      ceph_assert(0 == "registered under wrong command?");    
+      ceph_abort_msg("registered under wrong command?");    
     }
     f->close_section();
   }
index d9b3acfec48c0bbf88e0407b729dd1390b168275..c423c0818b841134695bf178d6fbbe8a2ad9da2f 100644 (file)
@@ -32,7 +32,7 @@ extern void dout_emergency(const std::string &str);
 class _bad_endl_use_dendl_t { public: _bad_endl_use_dendl_t(int) {} };
 static const _bad_endl_use_dendl_t endl = 0;
 inline std::ostream& operator<<(std::ostream& out, _bad_endl_use_dendl_t) {
-  ceph_assert(0 && "you are using the wrong endl.. use std::endl or dendl");
+  ceph_abort_msg("you are using the wrong endl.. use std::endl or dendl");
   return out;
 }
 
index de442825bd1cf712ee2216036d951207336feb6f..dc4832e36499b01bc733ddacd6128a2d89b76279 100644 (file)
@@ -79,8 +79,8 @@ public:
 
     int i = 0;
     for (const auto &ac : axes_config) {
-      ceph_assert(ac.m_buckets > 0 && "Must have at least one bucket on axis");
-      ceph_assert(ac.m_quant_size > 0 &&
+      ceph_assertf(ac.m_buckets > 0, "Must have at least one bucket on axis");
+      ceph_assertf(ac.m_quant_size > 0,
              "Quantization unit must be non-zero positive integer value");
 
       m_axes_config[i++] = ac;
@@ -178,8 +178,8 @@ protected:
     static_assert(sizeof...(T) == DIM, "Incorrect number of arguments");
     return get_raw_index_internal<0>(
         [](int64_t bucket, const axis_config_d &ac) {
-          ceph_assert(bucket >= 0 && "Bucket index can not be negative");
-          ceph_assert(bucket < ac.m_buckets && "Bucket index too large");
+          ceph_assertf(bucket >= 0, "Bucket index can not be negative");
+          ceph_assertf(bucket < ac.m_buckets, "Bucket index too large");
           return bucket;
         },
         0, buckets...);
index e7984223bbb9c3ce1c1bb3e51b067ba23fdb385b..67a3e3d177184bff7fdc6688438347673dd76a06 100644 (file)
@@ -245,12 +245,12 @@ bool SocketConnection::update_rx_seq(seq_num_t seq)
   if (seq <= in_seq) {
     if (HAVE_FEATURE(features, RECONNECT_SEQ) &&
         conf.ms_die_on_old_message) {
-      ceph_assert(0 == "old msgs despite reconnect_seq feature");
+      ceph_abort_msg("old msgs despite reconnect_seq feature");
     }
     return false;
   } else if (seq > in_seq + 1) {
     if (conf.ms_die_on_skipped_message) {
-      ceph_assert(0 == "skipped incoming seq");
+      ceph_abort_msg("skipped incoming seq");
     }
     return false;
   } else {
index 361a638ee422ba02e176382beebbd19c54b985b1..c1cbc2936aa9fa3985558eda708b4366a3713f48 100644 (file)
@@ -1642,7 +1642,7 @@ int32_t CrushWrapper::_alloc_class_id() const {
       }
     }
   } while (class_id != start);
-  ceph_assert(0 == "no available class id");
+  ceph_abort_msg("no available class id");
 }
 
 void CrushWrapper::reweight(CephContext *cct)
index 2a6c68c83dadf4d2118eda96d6d36ff6624ab0c6..22f9cd48d204cc1fe2916b128d8c820caccada6f 100644 (file)
@@ -193,7 +193,7 @@ int ErasureCode::encode(const set<int> &want_to_encode,
 int ErasureCode::encode_chunks(const set<int> &want_to_encode,
                                map<int, bufferlist> *encoded)
 {
-  ceph_assert("ErasureCode::encode_chunks not implemented" == 0);
+  ceph_abort_msg("ErasureCode::encode_chunks not implemented");
 }
  
 int ErasureCode::_decode(const set<int> &want_to_read,
@@ -245,7 +245,7 @@ int ErasureCode::decode_chunks(const set<int> &want_to_read,
                                const map<int, bufferlist> &chunks,
                                map<int, bufferlist> *decoded)
 {
-  ceph_assert("ErasureCode::decode_chunks not implemented" == 0);
+  ceph_abort_msg("ErasureCode::decode_chunks not implemented");
 }
 
 int ErasureCode::parse(const ErasureCodeProfile &profile,
index a07d167e36a99d462e45871409f7fc708c55e217..e03a1f9071460d7a3bf76899439c032cd8561750 100644 (file)
@@ -514,10 +514,10 @@ bool operator!=(const std::vector<T, mempool::pool_allocator<pool_index, T>>& lh
 #define MEMPOOL_CLASS_HELPERS()                                                \
   void *operator new(size_t size);                                     \
   void *operator new[](size_t size) noexcept {                         \
-    ceph_assert(0 == "no array new");                                  \
+    ceph_abort_msg("no array new");                                    \
     return nullptr; }                                                  \
   void  operator delete(void *);                                       \
-  void  operator delete[](void *) { ceph_assert(0 == "no array delete"); }
+  void  operator delete[](void *) { ceph_abort_msg("no array delete"); }
 
 
 // Use this in some particular .cc file to match each class with a
index 942aa61b5f47ab10cf6f5c0b884e2801087f2dce..cdf3ef28a93bb6d05f359cb8eb8389c76fa5bd74 100644 (file)
@@ -279,7 +279,7 @@ int KvFlatBtreeAsync::read_index(const string &key, index_data * idata,
     cerr << "\t" << client_name
        << "-read_index: getting keys failed with "
        << err << std::endl;
-    ceph_assert(0 == client_name + "-read_index: reading index failed");
+    ceph_abort_msg(client_name + "-read_index: reading index failed");
     return err;
   }
   kvmap.insert(dupmap.begin(), dupmap.end());
index 0f5c509726d3171727b7305c4dee7bf90f8f62b3..f9d9665aed63e1f26c3a76645df83853f6ebc030 100644 (file)
@@ -142,7 +142,7 @@ public:
       const std::string &prefix,   ///< [in] Prefix/CF ==> MUST match some established merge operator
       const std::string &key,      ///< [in] Key to be merged
       const bufferlist  &value     ///< [in] value to be merged into key
-    ) { ceph_assert(0 == "Not implemented"); }
+    ) { ceph_abort_msg("Not implemented"); }
 
     virtual ~TransactionImpl() {}
   };
index 95c76380e042c28812432e5e8efbfd05d57c78d0..ac6ac8f38fb11c717a94564fbcfd07d7351cb475 100644 (file)
@@ -47,7 +47,7 @@ int KineticStore::_test_init(CephContext *c)
 int KineticStore::open(ostream &out, const vector<ColumnFamily>& cfs)
 {
   if (!cfs.empty()) {
-    ceph_assert(0 == "Not implemented");
+    ceph_abort_msg("Not implemented");
   }
   return do_open(out, false);
 }
@@ -55,7 +55,7 @@ int KineticStore::open(ostream &out, const vector<ColumnFamily>& cfs)
 int KineticStore::create_and_open(ostream &out, const vector<ColumnFamily>& cfs)
 {
   if (!cfs.empty()) {
-    ceph_assert(0 == "Not implemented");
+    ceph_abort_msg("Not implemented");
   }
   return do_open(out, true);
 }
index 214cf77c4120e3c028214d5a362aecd74789bea7..fdad594bba321559ad64f44e538f61711d7e7e06 100644 (file)
@@ -61,14 +61,14 @@ int LevelDBStore::init(string option_str)
 
 int LevelDBStore::open(ostream &out, const vector<ColumnFamily>& cfs)  {
   if (!cfs.empty()) {
-    ceph_assert(0 == "Not implemented");
+    ceph_abort_msg("Not implemented");
   }
   return do_open(out, false);
 }
 
 int LevelDBStore::create_and_open(ostream &out, const vector<ColumnFamily>& cfs) {
   if (!cfs.empty()) {
-    ceph_assert(0 == "Not implemented");
+    ceph_abort_msg("Not implemented");
   }
   return do_open(out, true);
 }
@@ -93,7 +93,7 @@ int LevelDBStore::load_leveldb_options(bool create_if_missing, leveldb::Options
     filterpolicy.reset(_filterpolicy);
     ldoptions.filter_policy = filterpolicy.get();
 #else
-    ceph_assert(0 == "bloom size set but installed leveldb doesn't support bloom filters");
+    ceph_abort_msg(0 == "bloom size set but installed leveldb doesn't support bloom filters");
 #endif
   }
   if (options.compression_enabled)
index 649352fd51befc3fe847fbb1f66128d5121140b4..cadda26d5716d6e2a97cfb1016d4e25e690d7dbd 100644 (file)
@@ -177,14 +177,14 @@ int MemDB::do_open(ostream &out, bool create)
 
 int MemDB::open(ostream &out, const vector<ColumnFamily>& cfs) {
   if (!cfs.empty()) {
-    ceph_assert(0 == "Not implemented");
+    ceph_abort_msg("Not implemented");
   }
   return do_open(out, false);
 }
 
 int MemDB::create_and_open(ostream &out, const vector<ColumnFamily>& cfs) {
   if (!cfs.empty()) {
-    ceph_assert(0 == "Not implemented");
+    ceph_abort_msg("Not implemented");
   }
   return do_open(out, true);
 }
index bc60dfe010e73ea67f88bf49278b67e47539b79e..2b6dccc5cfcae5272d1d29860e3587287c1b3be6 100644 (file)
@@ -23,7 +23,7 @@ void ObjectDispatchSpec::C_Dispatcher::complete(int r) {
     finish(r);
     break;
   case DISPATCH_RESULT_INVALID:
-    ceph_assert(false);
+    ceph_abort();
     break;
   }
 }
index d1ce8f1461cbd0553ce72d4773ff9f5ab4188796..f27dc9668c7e51f91198988e69c558bae2ff6f30 100644 (file)
@@ -327,7 +327,7 @@ public:
     case DISCARD_ACTION_ZERO:
       return "zero";
     }
-    ceph_assert(false);
+    ceph_abort();
     return nullptr;
   }
 
@@ -371,7 +371,7 @@ protected:
       wr->zero(this->m_object_off, this->m_object_len);
       break;
     default:
-      ceph_assert(false);
+      ceph_abort();
       break;
     }
   }
index 654356b6887f91af9d8e1618d2f2fe20100356b1..99f3b012d2cbc0bd0f5e8198f1d45ca269e260d2 100644 (file)
@@ -30,7 +30,7 @@ protected:
     return true;
   }
   journal::Event create_event(uint64_t op_tid) const override {
-    ceph_assert(0);
+    ceph_abort();
     return journal::UnknownEvent();
   }
 
index e0950815e8fa1bdbb3e4d87445e0125f6bcd5ef0..d70d77453d99119a60fe1e44e23a9e86b2af7c93 100644 (file)
@@ -113,7 +113,7 @@ void Locker::dispatch(const Message::const_ref &m)
     break;
   default:
     derr << "locker unknown message " << m->get_type() << dendl;
-    ceph_assert(0 == "locker unknown message");
+    ceph_abort_msg("locker unknown message");
   }
 }
 
@@ -4699,7 +4699,7 @@ void Locker::scatter_tempsync(ScatterLock *lock, bool *need_issue)
   ceph_assert(lock->get_parent()->is_auth());
   ceph_assert(lock->is_stable());
 
-  ceph_assert(0 == "not fully implemented, at least not for filelock");
+  ceph_abort_msg("not fully implemented, at least not for filelock");
 
   CInode *in = static_cast<CInode *>(lock->get_parent());
 
index 26c3177deac846a848c974cc5906a26fc9a0d6b8..1a029135dc6930d1c09ac57e40b600221592b546 100644 (file)
@@ -69,7 +69,7 @@ int MDBalancer::proc_message(const Message::const_ref &m)
 
   default:
     derr << " balancer unknown message " << m->get_type() << dendl_impl;
-    ceph_assert(0 == "balancer unknown message");
+    ceph_abort_msg("balancer unknown message");
   }
 
   return 0;
index 28ac5a41a397b5775dd5fae8dbf247adc158f5dc..a115fdbdb0e17f09ca4ff154de4a8ef9fb76f886 100644 (file)
@@ -5791,7 +5791,7 @@ void MDCache::do_cap_import(Session *session, CInode *in, Capability *cap,
     reap->set_cap_peer(p_cap_id, p_seq, p_mseq, peer, p_flags);
     mds->send_message_client_counted(reap, session);
   } else {
-    ceph_assert(0);
+    ceph_abort();
   }
 }
 
@@ -7968,7 +7968,7 @@ void MDCache::dispatch(const Message::const_ref &m)
     
   default:
     derr << "cache unknown message " << m->get_type() << dendl;
-    ceph_assert(0 == "cache unknown message");
+    ceph_abort_msg("cache unknown message");
   }
 }
 
index af0fe5b38415353fcd6930fa4e54a6c6ebcd0540..4187fee082f540b6d6be89d27451ec829368bc32 100644 (file)
@@ -139,7 +139,7 @@ void MDSTableClient::handle_request(const MMDSTableRequest::const_ref &m)
     break;
 
   default:
-    ceph_assert(0 == "unrecognized mds_table_client request op");
+    ceph_abort_msg("unrecognized mds_table_client request op");
   }
 }
 
index 138c0d669faf85218282fad23fd6dff4517b9f1e..ffba78c0ef2540d7c6a3881c53c8fc3f99b43535 100644 (file)
@@ -33,7 +33,7 @@ void MDSTableServer::handle_request(const MMDSTableRequest::const_ref &req)
   case TABLESERVER_OP_COMMIT: return handle_commit(req);
   case TABLESERVER_OP_ROLLBACK: return handle_rollback(req);
   case TABLESERVER_OP_NOTIFY_ACK: return handle_notify_ack(req);
-  default: ceph_assert(0 == "unrecognized mds_table_server request op");
+  default: ceph_abort_msg("unrecognized mds_table_server request op");
   }
 }
 
index b4dfe09040568cf9fbfaf87ffd342de5b9789014..3c6473def58fcbffedc362c8fbb069864a798766 100644 (file)
@@ -148,7 +148,7 @@ void Migrator::dispatch(const Message::const_ref &m)
 
   default:
     derr << "migrator unknown message " << m->get_type() << dendl;
-    ceph_assert(0 == "migrator unknown message");
+    ceph_abort_msg("migrator unknown message");
   }
 }
 
@@ -2432,7 +2432,7 @@ void Migrator::handle_export_cancel(const MExportDirCancel::const_ref &m)
   dirfrag_t df = m->get_dirfrag();
   map<dirfrag_t,import_state_t>::iterator it = import_state.find(df);
   if (it == import_state.end()) {
-    ceph_assert(0 == "got export_cancel in weird state");
+    ceph_abort_msg("got export_cancel in weird state");
   } else if (it->second.state == IMPORT_DISCOVERING) {
     import_reverse_discovering(df);
   } else if (it->second.state == IMPORT_DISCOVERED) {
@@ -2453,7 +2453,7 @@ void Migrator::handle_export_cancel(const MExportDirCancel::const_ref &m)
     cache->adjust_subtree_auth(dir, it->second.peer);
     import_reverse_unfreeze(dir);
   } else {
-    ceph_assert(0 == "got export_cancel in weird state");
+    ceph_abort_msg("got export_cancel in weird state");
   }
 }
 
@@ -2566,7 +2566,7 @@ void Migrator::handle_export_prep(const MExportDirPrep::const_ref &m, bool did_a
       } else if (start == '-') {
        // nothing
       } else
-       ceph_assert(0 == "unrecognized start char");
+       ceph_abort_msg("unrecognized start char");
 
       while (!q.end()) {
        CDentry *dn = cache->add_replica_dentry(q, cur, finished);
index a8795d2ade8f2b2f86ad03444f562eef7f348785..d9777581f0abb2692096e41d711b1029f18d9cc8 100644 (file)
@@ -1010,7 +1010,7 @@ void OpenFileTable::_open_ino_finish(inodeno_t ino, int r)
       finish_contexts(g_ceph_context, waiting_for_prefetch);
       waiting_for_prefetch.clear();
     } else {
-      ceph_assert(0);
+      ceph_abort();
     }
   }
 }
@@ -1093,7 +1093,7 @@ void OpenFileTable::_prefetch_inodes()
   else if (prefetch_state == FILE_INODES)
     pool = mds->mdsmap->get_first_data_pool();
   else
-    ceph_assert(0);
+    ceph_abort();
 
   MDCache *mdcache = mds->mdcache;
 
index 5728f11f1c1467638de2aca6ca29456806db94c2..72efb1752cd004a746164798b241087096fd9c7f 100644 (file)
@@ -264,7 +264,7 @@ void Server::dispatch(const Message::const_ref &m)
     return;
   default:
     derr << "server unknown message " << m->get_type() << dendl;
-    ceph_assert(0 == "server unknown message");  
+    ceph_abort_msg("server unknown message");  
   }
 }
 
@@ -1380,7 +1380,7 @@ void Server::respond_to_request(MDRequestRef& mdr, int r)
   } else if (mdr->internal_op > -1) {
     dout(10) << "respond_to_request on internal request " << mdr << dendl;
     if (!mdr->internal_op_finish)
-      ceph_assert(0 == "trying to respond to internal op without finisher");
+      ceph_abort_msg("trying to respond to internal op without finisher");
     mdr->internal_op_finish->complete(r);
     mdcache->request_finish(mdr);
   }
index afe37fe7a6bb5e9f627e168b347d40c4ac49b9f3..429238b7b8b30816a06998ed99dbf8109f49e3a8 100644 (file)
@@ -324,7 +324,7 @@ void SessionMap::_load_legacy_finish(int r, bufferlist &bl)
   auto blp = bl.cbegin();
   if (r < 0) {
     derr << "_load_finish got " << cpp_strerror(r) << dendl;
-    ceph_assert(0 == "failed to load sessionmap");
+    ceph_abort_msg("failed to load sessionmap");
   }
   dump();
   decode_legacy(blp);  // note: this sets last_cap_renew = now()
index 0a21a756e56a20515134903928803a733b8c3d22..7c4262fc51ec1209e10165140cc0594019ae4ac2 100644 (file)
@@ -123,7 +123,7 @@ public:
     else if (ino == MDS_INO_MDSDIR(rank))
       mdsdir_scrubbed = true;
     else
-      ceph_assert(0);
+      ceph_abort();
   }
   bool can_allow_multimds_snaps() const {
     return (root_scrubbed && mdsdir_scrubbed) ||
index 0ace8b8c089913392d4b4152338f6ba92767cbce..145e962e3aeb09c7039000cad477e5b01a8f0266 100644 (file)
@@ -203,7 +203,7 @@ void StrayManager::_purge_stray_purged(
       // is being purged (aside from it were 
 
       derr << "Rogue reference after purge to " << *dn << dendl;
-      ceph_assert(0 == "rogue reference to purging inode");
+      ceph_abort_msg("rogue reference to purging inode");
     }
 
     // kill dentry.
index ed256e55e5e983ebad90c70e9414a5de265e61a2..86054158ae281e2053af5d2c6bc5658fe325614f 100644 (file)
@@ -311,7 +311,7 @@ void EMetaBlob::add_dir_context(CDir *dir, int mode)
                !dir->state_test(CDir::STATE_AUXSUBTREE) &&
                !diri->state_test(CInode::STATE_AMBIGUOUSAUTH)) {
              dout(0) << "EMetaBlob::add_dir_context unexpected subtree " << *dir << dendl;
-             ceph_assert(0);
+             ceph_abort();
            }
            dout(20) << "EMetaBlob::add_dir_context(" << dir << ") ambiguous or transient subtree " << dendl;
          } else {
index c97b371982f21d238ea5e7cc2412a5aadf761bdd..dda90d2f3ca43067ff457b5389fde46ec6e99b23 100644 (file)
@@ -57,11 +57,11 @@ public:
   }
 
   void encode_payload(uint64_t features) override {
-    ceph_assert(0 == "MMonQuorumService message must always be a base class");
+    ceph_abort_msg("MMonQuorumService message must always be a base class");
   }
 
   void decode_payload() override {
-    ceph_assert(0 == "MMonQuorumService message must always be a base class");
+    ceph_abort_msg("MMonQuorumService message must always be a base class");
   }
 
   const char *get_type_name() const override { return "quorum_service"; }
index b105be624ee2c33a91d2d699e54ca65cbaf4fc85..3232aa88a563e6955dd25b2528bc6e2c8fdf718b 100644 (file)
@@ -33,7 +33,7 @@ public:
     switch (op) {
     case OP_SCRUB: return "scrub";
     case OP_RESULT: return "result";
-    default: ceph_assert(0 == "unknown op type"); return NULL;
+    default: ceph_abort_msg("unknown op type"); return NULL;
     }
   }
 
index 8ccc2cdbc3fafa15828208f341ee09a5b504887d..595602a6e8455dea31fd3ed9cca9f55d128e7607 100644 (file)
@@ -51,7 +51,7 @@ public:
     case OP_CHUNK: return "chunk";
     case OP_LAST_CHUNK: return "last_chunk";
     case OP_NO_COOKIE: return "no_cookie";
-    default: ceph_assert(0 == "unknown op type"); return NULL;
+    default: ceph_abort_msg("unknown op type"); return NULL;
     }
   }
 
index 47fde57a65367123fd42e4c563e9d0156baadfe9..0a802227ce0450cf9ddca154b86a81f6bd9a434f 100644 (file)
@@ -1533,7 +1533,7 @@ bool DaemonServer::handle_command(MCommand *m)
                  }
                  break;
                default:
-                 ceph_assert(0 == "actual_op value is not supported");
+                 ceph_abort_msg("actual_op value is not supported");
              }
 
              parsed_pgs.push_back(std::move(parsed_pg));
index a71d6c67db211a054ad1a5fd94d745b2393ca6e3..90333629a60da41d99df3f65d51346d845efd32c 100644 (file)
@@ -301,7 +301,7 @@ void PyModule::init_ceph_module()
   for (auto [name, type] : classes) {
     type->tp_new = PyType_GenericNew;
     if (PyType_Ready(type) < 0) {
-      ceph_assert(0);
+      ceph_abort();
     }
     Py_INCREF(type);
 
index 3b050d29d4797856789e3014f8489b368236a5f1..f2381dc2cf08451ea81f7b5d39fed80fe10ea872 100644 (file)
@@ -192,8 +192,8 @@ BasePyOSDMap_init(BasePyOSDMap *self, PyObject *args, PyObject *kwds)
     if (! PyArg_ParseTupleAndKeywords(args, kwds, "O",
                                       const_cast<char**>(kwlist),
                                       &osdmap_capsule)) {
-      ceph_assert(0);
-        return -1;
+      ceph_abort();
+      return -1;
     }
     ceph_assert(PyObject_TypeCheck(osdmap_capsule, &PyCapsule_Type));
 
@@ -291,8 +291,8 @@ BasePyOSDMapIncremental_init(BasePyOSDMapIncremental *self,
     if (! PyArg_ParseTupleAndKeywords(args, kwds, "O",
                                       const_cast<char**>(kwlist),
                                       &inc_capsule)) {
-      ceph_assert(0);
-        return -1;
+      ceph_abort();
+      return -1;
     }
     ceph_assert(PyObject_TypeCheck(inc_capsule, &PyCapsule_Type));
 
@@ -460,8 +460,8 @@ BasePyCRUSH_init(BasePyCRUSH *self,
     if (! PyArg_ParseTupleAndKeywords(args, kwds, "O",
                                       const_cast<char**>(kwlist),
                                       &crush_capsule)) {
-      ceph_assert(0);
-        return -1;
+      ceph_abort();
+      return -1;
     }
     ceph_assert(PyObject_TypeCheck(crush_capsule, &PyCapsule_Type));
 
index 5cf0de4675cb606b26c44f6f39e12c3b1525cc90..d51e9e8948502905fb3a9baddf049abd36d0c456 100644 (file)
@@ -340,7 +340,7 @@ void Monitor::do_admin_command(std::string_view command, const cmdmap_t& cmdmap,
         please enable \"mon_enable_op_tracker\", and the tracker will start to track new ops received afterwards.";
     }
   } else {
-    ceph_assert(0 == "bad AdminSocket command binding");
+    ceph_abort_msg("bad AdminSocket command binding");
   }
   (read_only ? audit_clog->debug() : audit_clog->info())
     << "from='admin socket' "
@@ -1162,7 +1162,7 @@ void Monitor::sync_obtain_latest_monmap(bufferlist &bl)
       derr << __func__
            << " something wrong happened while reading the store: "
            << cpp_strerror(err) << dendl;
-      ceph_assert(0 == "error reading the store");
+      ceph_abort_msg("error reading the store");
     }
   } else {
     latest_monmap.decode(monmon_bl);
@@ -1176,7 +1176,7 @@ void Monitor::sync_obtain_latest_monmap(bufferlist &bl)
       derr << __func__
            << " something wrong happened while reading the store: "
            << cpp_strerror(err) << dendl;
-      ceph_assert(0 == "error reading the store");
+      ceph_abort_msg("error reading the store");
     }
     ceph_assert(backup_bl.length() > 0);
 
@@ -1363,7 +1363,7 @@ void Monitor::handle_sync(MonOpRequestRef op)
 
   default:
     dout(0) << __func__ << " unknown op " << m->op << dendl;
-    ceph_assert(0 == "unknown op");
+    ceph_abort_msg("unknown op");
   }
 }
 
@@ -3313,7 +3313,7 @@ void Monitor::handle_command(MonOpRequestRef op)
         ds << '\n';
       }
     } else {
-      ceph_assert(0 == "We should never get here!");
+      ceph_abort_msg("We should never get here!");
       return;
     }
     rdata.append(ds);
@@ -4381,7 +4381,7 @@ void Monitor::timecheck_start_round()
   ceph_assert(is_leader());
 
   if (monmap->size() == 1) {
-    ceph_assert(0 == "We are alone; this shouldn't have been scheduled!");
+    ceph_abort_msg("We are alone; this shouldn't have been scheduled!");
     return;
   }
 
@@ -4490,7 +4490,7 @@ void Monitor::timecheck_check_skews()
   ceph_assert(is_leader());
   ceph_assert((timecheck_round % 2) == 0);
   if (monmap->size() == 1) {
-    ceph_assert(0 == "We are alone; we shouldn't have gotten here!");
+    ceph_abort_msg("We are alone; we shouldn't have gotten here!");
     return;
   }
   ceph_assert(timecheck_latencies.size() == timecheck_skews.size());
@@ -4527,7 +4527,7 @@ void Monitor::timecheck_report()
   ceph_assert(is_leader());
   ceph_assert((timecheck_round % 2) == 0);
   if (monmap->size() == 1) {
-    ceph_assert(0 == "We are alone; we shouldn't have gotten here!");
+    ceph_abort_msg("We are alone; we shouldn't have gotten here!");
     return;
   }
 
@@ -4565,7 +4565,7 @@ void Monitor::timecheck()
   dout(10) << __func__ << dendl;
   ceph_assert(is_leader());
   if (monmap->size() == 1) {
-    ceph_assert(0 == "We are alone; we shouldn't have gotten here!");
+    ceph_abort_msg("We are alone; we shouldn't have gotten here!");
     return;
   }
   ceph_assert(timecheck_round % 2 != 0);
index e5311bb22327ca89d1cd653d8fde01e9f9393383..6f8e3ca451bcd052e365a1e78c64689a12acb082 100644 (file)
@@ -849,7 +849,7 @@ public:
       else if (r == -EAGAIN)
        mon->dispatch_op(op);
       else
-       ceph_assert(0 == "bad C_Command return value");
+       ceph_abort_msg("bad C_Command return value");
     }
   };
 
@@ -866,7 +866,7 @@ public:
       else if (r == -ECANCELED)
         return;
       else
-       ceph_assert(0 == "bad C_RetryMessage return value");
+       ceph_abort_msg("bad C_RetryMessage return value");
     }
   };
 
index 730c5ff6721d45f4bea10d2431d2a7293fb83e5d..e037ee44d86825adde336acef074c0305fde3a27 100644 (file)
@@ -308,7 +308,7 @@ class MonitorDBStore
        compact.pop_front();
       }
     } else {
-      ceph_assert(0 == "failed to write to db");
+      ceph_abort_msg("failed to write to db");
     }
     return r;
   }
@@ -533,7 +533,7 @@ class MonitorDBStore
       generic_dout(0) << "MonitorDBStore::get() error obtaining"
                       << " (" << prefix << ":" << key << "): "
                       << cpp_strerror(err) << dendl;
-      ceph_assert(0 == "error obtaining key");
+      ceph_abort_msg("error obtaining key");
     }
 
     ceph_assert(bl.length());
@@ -600,7 +600,7 @@ class MonitorDBStore
       derr << __func__ << " error initializing "
           << kv_type << " db back storage in "
           << full_path << dendl;
-      ceph_assert(0 == "MonitorDBStore: error initializing keyvaluedb back storage");
+      ceph_abort_msg("MonitorDBStore: error initializing keyvaluedb back storage");
     }
     db.reset(db_ptr);
 
index 818ef1a48180165493dd6b19fc98feb9bd19b79a..0e627399fef0502ab73a94928f90f4ef0f594351 100644 (file)
@@ -122,7 +122,7 @@ class C_ApplyFeatures : public Context {
       // established them in the first place.
       return;
     } else {
-      ceph_assert(0 == "bad C_ApplyFeatures return value");
+      ceph_abort_msg("bad C_ApplyFeatures return value");
     }
   }
 };
index 97bb06a4703f562fdfaa68d002a5ce2b0fab00a9..53e17974c4bbc4a63e84b62a84721a6b8bccb540 100644 (file)
@@ -347,7 +347,7 @@ void OSDMonitor::create_initial()
     int r = ceph_release_from_name(
       g_conf()->mon_osd_initial_require_min_compat_client.c_str());
     if (r <= 0) {
-      ceph_assert(0 == "mon_osd_initial_require_min_compat_client is not valid");
+      ceph_abort_msg("mon_osd_initial_require_min_compat_client is not valid");
     }
     newmap.require_min_compat_client = r;
   }
@@ -1704,7 +1704,7 @@ void OSDMonitor::load_osdmap_manifest()
   int r = get_value("osdmap_manifest", manifest_bl);
   if (r < 0) {
     derr << __func__ << " unable to read osdmap version manifest" << dendl;
-    ceph_assert(0 == "error reading manifest");
+    ceph_abort_msg("error reading manifest");
   }
   osdmap_manifest.decode(manifest_bl);
   has_osdmap_manifest = true;
@@ -3798,7 +3798,7 @@ int OSDMonitor::get_full_from_pinned_map(version_t ver, bufferlist& bl)
         derr << __func__
              << "    osdmap crc mismatch! (osdmap crc " << tosdm.get_crc()
              << ", expected " << inc.full_crc << ")" << dendl;
-        ceph_assert(0 == "osdmap crc mismatch");
+        ceph_abort_msg("osdmap crc mismatch");
       }
     }
 
@@ -7423,7 +7423,7 @@ void OSDMonitor::do_osd_create(
     *new_id = pending_inc.new_max_osd - 1;
     ceph_assert(*new_id == allocated_id);
   } else {
-    ceph_assert(0 == "unexpected condition");
+    ceph_abort_msg("unexpected condition");
   }
 
 out:
@@ -9969,7 +9969,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
           break;
 
         default:
-         ceph_assert(0 == "invalid option");
+         ceph_abort_msg("invalid option");
         }
       }
     }
@@ -10031,7 +10031,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
           osdmap.get_noout_osds(&osds);
           break;
         default:
-          ceph_assert(0 == "invalid option");
+          ceph_abort_msg("invalid option");
         }
 
         // cancel any pending noup/nodown/noin/noout requests too
@@ -10069,7 +10069,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
             break;
 
           default:
-            ceph_assert(0 == "invalid option");
+            ceph_abort_msg("invalid option");
           }
         }
 
@@ -10137,7 +10137,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
             break;
 
           default:
-            ceph_assert(0 == "invalid option");
+            ceph_abort_msg("invalid option");
         }
       }
     }
@@ -10387,7 +10387,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       break;
 
     default:
-      ceph_assert(0 == "invalid option");
+      ceph_abort_msg("invalid option");
     }
 
     switch (option) {
@@ -10530,7 +10530,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
       break;
 
     default:
-      ceph_assert(0 == "invalid option");
+      ceph_abort_msg("invalid option");
     }
 
     goto update;
@@ -11779,7 +11779,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     } else if (field == "max_bytes") {
       value = strict_iecstrtoll(val.c_str(), &tss);
     } else {
-      ceph_assert(0 == "unrecognized option");
+      ceph_abort_msg("unrecognized option");
     }
     if (!tss.empty()) {
       ss << "error parsing value '" << val << "': " << tss;
@@ -11793,7 +11793,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     } else if (field == "max_bytes") {
       pi->quota_max_bytes = value;
     } else {
-      ceph_assert(0 == "unrecognized option");
+      ceph_abort_msg("unrecognized option");
     }
     ss << "set-quota " << field << " = " << value << " for pool " << poolstr;
     rs = ss.str();
index 9dfbf4c8a0ee848b412f63002b8e0e1d4e19634a..00560e06889763eaecb5af31fd8077a609ce0005 100644 (file)
@@ -491,7 +491,7 @@ private:
       else if (r == -EAGAIN)
         cmon->dispatch(op);
       else
-       ceph_assert(0 == "bad C_Booted return value");
+       ceph_abort_msg("bad C_Booted return value");
     }
   };
 
@@ -508,7 +508,7 @@ private:
       else if (r == -EAGAIN)
        osdmon->dispatch(op);
       else
-       ceph_assert(0 == "bad C_ReplyMap return value");
+       ceph_abort_msg("bad C_ReplyMap return value");
     }    
   };
   struct C_PoolOp : public C_MonOp {
@@ -529,7 +529,7 @@ private:
       else if (r == -EAGAIN)
        osdmon->dispatch(op);
       else
-       ceph_assert(0 == "bad C_PoolOp return value");
+       ceph_abort_msg("bad C_PoolOp return value");
     }
   };
 
index 63939f600cb8ed787c3886b1830aab9534539817..488b4a97f96403cab35a2a5ee26ab85416ff2244 100644 (file)
@@ -684,7 +684,7 @@ static float pool_raw_used_rate(const OSDMap &osd_map, int64_t poolid)
   }
   break;
   default:
-    ceph_assert(0 == "unrecognized pool type");
+    ceph_abort_msg("unrecognized pool type");
   }
 }
 
index f4894b58bb26d38ea5ed28fe6f75397da78841b1..7d3ff2c7b98763c4f9e56b0e6f5adde817195dd3 100644 (file)
@@ -124,7 +124,7 @@ bool PaxosService::dispatch(MonOpRequestRef op)
         } else if (r == -ECANCELED || r == -EAGAIN) {
           return;
         } else {
-          ceph_assert(0 == "bad return value for proposal_timer");
+          ceph_abort_msg("bad return value for proposal_timer");
         }
     });
     dout(10) << " setting proposal_timer " << do_propose
@@ -240,7 +240,7 @@ void PaxosService::propose_pending()
       else if (r == -ECANCELED || r == -EAGAIN)
        return;
       else
-       ceph_assert(0 == "bad return value for C_Committed");
+       ceph_abort_msg("bad return value for C_Committed");
     }
   };
   paxos->queue_pending_finisher(new C_Committed(this));
index 07a51c8ebe6e2a8e64fde628631aa259ed71f8ca..3e396b3786171b6c40778fcc189732fef5a81777 100644 (file)
@@ -120,7 +120,7 @@ public:
       else if (r == -ECANCELED)
         return;
       else
-       ceph_assert(0 == "bad C_RetryMessage return value");
+       ceph_abort_msg("bad C_RetryMessage return value");
     }
   };
 
index f0e0f8af4e0923507308e240a5b80e0dd2a69c48..04067411c93dbf1ca6339f991c15d986035fbb72 100644 (file)
@@ -632,7 +632,7 @@ public:
   /**
    *  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, ceph_assert(0).
+   *  If none of our Dispatchers can handle it, ceph_abort().
    *
    *  @param m The Message to deliver.
    */
index 674a6714871c412987fd0b8b6964be940941892f..15027e5b54d4d81458cd3f6f0d975fd990152a3c 100644 (file)
@@ -726,14 +726,14 @@ void AsyncConnection::process()
                     << ", discarding" << dendl;
             message->put();
             if (has_feature(CEPH_FEATURE_RECONNECT_SEQ) && async_msgr->cct->_conf->ms_die_on_old_message)
-              ceph_assert(0 == "old msgs despite reconnect_seq feature");
+              ceph_abort_msg("old msgs despite reconnect_seq feature");
             break;
           }
           if (message->get_seq() > cur_seq + 1) {
             ldout(async_msgr->cct, 0) << __func__ << " missed message?  skipped from seq "
                                       << cur_seq << " to " << message->get_seq() << dendl;
             if (async_msgr->cct->_conf->ms_die_on_skipped_message)
-              ceph_assert(0 == "skipped incoming seq");
+              ceph_abort_msg("skipped incoming seq");
           }
 
           message->set_connection(this);
index aee9a390493c1ec15801e30c198ff1e46525ba12..bb48622a226ccce7fe90c83c740f824a08c7a1c0 100644 (file)
@@ -234,7 +234,7 @@ int EventCenter::create_file_event(int fd, int mask, EventCallbackRef ctxt)
     // add_event shouldn't report error, otherwise it must be a innermost bug!
     lderr(cct) << __func__ << " add event failed, ret=" << r << " fd=" << fd
                << " mask=" << mask << " original mask is " << event->mask << dendl;
-    ceph_assert(0 == "BUG!");
+    ceph_abort_msg("BUG!");
     return r;
   }
 
@@ -267,7 +267,7 @@ void EventCenter::delete_file_event(int fd, int mask)
   int r = driver->del_event(fd, event->mask, mask);
   if (r < 0) {
     // see create_file_event
-    ceph_assert(0 == "BUG!");
+    ceph_abort_msg("BUG!");
   }
 
   if (mask & EVENT_READABLE && event->read_cb) {
index d5762d6eb5ccd6bdb27cebee948ced64fbf34024..ca39b09f26d4c98e123a51257d9194ea9039feb2 100644 (file)
@@ -142,7 +142,7 @@ void RDMAIWARPConnectedSocketImpl::handle_cm_connection() {
       break;
 
     default:
-      ceph_assert(0 == "unhandled event");
+      ceph_abort_msg("unhandled event");
       break;
   }
   rdma_ack_cm_event(event);
index d8f595eade51c385de444e02f58e9f4bc1c3596b..8005cf8947da473d5cfc7397dc11f3d41f375400 100644 (file)
@@ -1773,14 +1773,14 @@ void Pipe::reader()
        m->put();
        if (connection_state->has_feature(CEPH_FEATURE_RECONNECT_SEQ) &&
            msgr->cct->_conf->ms_die_on_old_message)
-         ceph_assert(0 == "old msgs despite reconnect_seq feature");
+         ceph_abort_msg("old msgs despite reconnect_seq feature");
        continue;
       }
       if (m->get_seq() > in_seq + 1) {
        ldout(msgr->cct,0) << "reader missed message?  skipped from seq "
                           << in_seq << " to " << m->get_seq() << dendl;
        if (msgr->cct->_conf->ms_die_on_skipped_message)
-         ceph_assert(0 == "skipped incoming seq");
+         ceph_abort_msg("skipped incoming seq");
       }
 
       m->set_connection(connection_state.get());
index 85b4ef329d1c3b4d8cbfb1f7e50b4c95b4ae218a..2ef00640f24e01b517cee14a407b5a3229cb2ff0 100644 (file)
@@ -683,7 +683,7 @@ public:
         break;
 
       default:
-        ceph_assert(0 == "Unknown OP");
+        ceph_abort_msg("Unknown OP");
       }
     }
     void _update_op_bl(
index 2435a0a19444d59cf79701695caddb132f28e57b..87066f0942dceb2a7e474d519374bf2804a9c649 100644 (file)
@@ -452,7 +452,7 @@ void BitmapFreelistManager::_verify_range(uint64_t offset, uint64_t length,
   }
   if (errors) {
     derr << __func__ << " saw " << errors << " errors" << dendl;
-    ceph_assert(0 == "bitmap freelist errors");
+    ceph_abort_msg("bitmap freelist errors");
   }
 }
 
index bf81bfa73578e477dd867627e532c6f65a2aa985..837282b63110e8553c73c689a298cd63906b6895 100644 (file)
@@ -713,7 +713,7 @@ int BlueFS::_replay(bool noop, bool to_stdout)
              dout(10) << __func__ << " 0x" << std::hex << read_pos
                       << ": stop: failed to skip to " << offset
                       << std::dec << dendl;
-             ceph_assert(0 == "problem with op_jump");
+             ceph_abort_msg("problem with op_jump");
            }
          }
        }
@@ -1663,7 +1663,7 @@ int BlueFS::_flush_range(FileWriter *h, uint64_t offset, uint64_t length)
       derr << __func__ << " allocated: 0x" << std::hex << allocated
            << " offset: 0x" << offset << " length: 0x" << length << std::dec
            << dendl;
-      ceph_assert(0 == "bluefs enospc");
+      ceph_abort_msg("bluefs enospc");
       return r;
     }
     if (cct->_conf->bluefs_preextend_wal_files &&
@@ -1900,7 +1900,7 @@ int BlueFS::_truncate(FileWriter *h, uint64_t offset)
             << " unflushed bytes" << dendl;
     t.substr_of(h->buffer, 0, offset - h->pos);
     h->buffer.swap(t);
-    ceph_assert(0 == "actually this shouldn't happen");
+    ceph_abort_msg("actually this shouldn't happen");
   }
   if (h->buffer.length()) {
     int r = _flush(h, true);
@@ -1911,7 +1911,7 @@ int BlueFS::_truncate(FileWriter *h, uint64_t offset)
     return 0;  // no-op!
   }
   if (offset > h->file->fnode.size) {
-    ceph_assert(0 == "truncate up not supported");
+    ceph_abort_msg("truncate up not supported");
   }
   ceph_assert(h->file->fnode.size >= offset);
   h->file->fnode.size = offset;
index b33005e149b41de543db2259aed94b870f37b4fb..c384f2ecb091a9618d37b7be2d6951c3d59d954f 100644 (file)
@@ -23,7 +23,7 @@ rocksdb::Status err_to_status(int r)
     return rocksdb::Status::IOError(strerror(r));
   default:
     // FIXME :(
-    ceph_assert(0 == "unrecognized error code");
+    ceph_abort_msg("unrecognized error code");
     return rocksdb::Status::NotSupported(rocksdb::Status::kNone);
   }
 }
index 5f9935d350d9410b9f4ea4def8952275f985c80b..90f2a0e8690997cd3cc4fca69cb58fad04cf2a84 100644 (file)
@@ -777,7 +777,7 @@ BlueStore::Cache *BlueStore::Cache::create(CephContext* cct, string type,
   else if (type == "2q")
     c = new TwoQCache(cct);
   else
-    ceph_assert(0 == "unrecognized cache type");
+    ceph_abort_msg("unrecognized cache type");
 
   c->logger = logger;
   return c;
@@ -925,7 +925,7 @@ void BlueStore::TwoQCache::_add_buffer(Buffer *b, int level, Buffer *near)
       buffer_hot.insert(buffer_hot.iterator_to(*near), *b);
       break;
     default:
-      ceph_assert(0 == "bad cache_private");
+      ceph_abort_msg("bad cache_private");
     }
   } else if (b->cache_private == BUFFER_NEW) {
     b->cache_private = BUFFER_WARM_IN;
@@ -952,7 +952,7 @@ void BlueStore::TwoQCache::_add_buffer(Buffer *b, int level, Buffer *near)
       buffer_hot.push_front(*b);
       break;
     default:
-      ceph_assert(0 == "bad cache_private");
+      ceph_abort_msg("bad cache_private");
     }
   }
   if (!b->is_empty()) {
@@ -981,7 +981,7 @@ void BlueStore::TwoQCache::_rm_buffer(Buffer *b)
     buffer_hot.erase(buffer_hot.iterator_to(*b));
     break;
   default:
-    ceph_assert(0 == "bad cache_private");
+    ceph_abort_msg("bad cache_private");
   }
 }
 
@@ -1005,7 +1005,7 @@ void BlueStore::TwoQCache::_move_buffer(Cache *srcc, Buffer *b)
     buffer_hot.push_back(*b);
     break;
   default:
-    ceph_assert(0 == "bad cache_private");
+    ceph_abort_msg("bad cache_private");
   }
   if (!b->is_empty()) {
     buffer_bytes += b->length;
@@ -2178,7 +2178,7 @@ bid_t BlueStore::ExtentMap::allocate_spanning_blob_id()
       if (bid < 0) bid = 0;
     }
   } while (bid != begin_bid);
-  ceph_assert(0 == "no available blob id");
+  ceph_abort_msg("no available blob id");
 }
 
 void BlueStore::ExtentMap::reshard(
@@ -2779,7 +2779,7 @@ void BlueStore::ExtentMap::dirty_range(
       derr << __func__ << "on write 0x" << std::hex << offset
           << "~" << length << " shard 0x" << p->shard_info->offset
           << std::dec << " is not loaded, can't mark dirty" << dendl;
-      ceph_assert(0 == "can't mark unloaded shard dirty");
+      ceph_abort_msg("can't mark unloaded shard dirty");
     }
     if (!p->dirty) {
       dout(20) << __func__ << " mark shard 0x" << std::hex
@@ -3252,7 +3252,7 @@ void BlueStore::Collection::load_shared_blob(SharedBlobRef sb)
        lderr(store->cct) << __func__ << " sbid 0x" << std::hex << sbid
                          << std::dec << " not found at key "
                          << pretty_binary_string(key) << dendl;
-      ceph_assert(0 == "uh oh, missing shared_blob");
+      ceph_abort_msg("uh oh, missing shared_blob");
     }
 
     sb->loaded = true;
@@ -6660,7 +6660,7 @@ int BlueStore::_fsck(bool deep, bool repair)
            if (r < 0) {
              derr << __func__ << " failed to read from 0x" << std::hex << e->offset
                    <<"~" << e->length << std::dec << dendl;
-             ceph_assert(0 == "read failed, wtf");
+             ceph_abort_msg("read failed, wtf");
            }
            pext_to_release.push_back(*e);
            e = pextents.erase(e);
@@ -8421,7 +8421,7 @@ int BlueStore::_open_super_meta()
       freelist_type = std::string(bl.c_str(), bl.length());
       dout(10) << __func__ << " freelist_type " << freelist_type << dendl;
     } else {
-      ceph_assert("Not Support extent freelist manager" == 0);
+      ceph_abort_msg("Not Support extent freelist manager");
     }
   }
 
@@ -8732,7 +8732,7 @@ void BlueStore::_txc_state_proc(TransContext *txc)
     default:
       derr << __func__ << " unexpected txc " << txc
           << " state " << txc->get_state_name() << dendl;
-      ceph_assert(0 == "unexpected txc state");
+      ceph_abort_msg("unexpected txc state");
       return;
     }
   }
@@ -9845,7 +9845,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
       break;
 
     case Transaction::OP_SPLIT_COLLECTION:
-      ceph_assert(0 == "deprecated");
+      ceph_abort_msg("deprecated");
       break;
 
     case Transaction::OP_SPLIT_COLLECTION2:
@@ -9889,7 +9889,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
       break;
 
     case Transaction::OP_COLL_RENAME:
-      ceph_assert(0 == "not implemented");
+      ceph_abort_msg("not implemented");
       break;
     }
     if (r < 0) {
@@ -9897,7 +9897,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
            << " not handled on operation " << op->op
            << " (op " << pos << ", counting from 0)" << dendl;
       _dump_transaction<0>(t);
-      ceph_assert(0 == "unexpected error");
+      ceph_abort_msg("unexpected error");
     }
 
     // these operations implicity create the object
@@ -10007,7 +10007,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
       break;
 
     case Transaction::OP_CLONERANGE:
-      ceph_assert(0 == "deprecated");
+      ceph_abort_msg("deprecated");
       break;
 
     case Transaction::OP_CLONERANGE2:
@@ -10025,15 +10025,15 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
       break;
 
     case Transaction::OP_COLL_ADD:
-      ceph_assert(0 == "not implemented");
+      ceph_abort_msg("not implemented");
       break;
 
     case Transaction::OP_COLL_REMOVE:
-      ceph_assert(0 == "not implemented");
+      ceph_abort_msg("not implemented");
       break;
 
     case Transaction::OP_COLL_MOVE:
-      ceph_assert(0 == "deprecated");
+      ceph_abort_msg("deprecated");
       break;
 
     case Transaction::OP_COLL_MOVE_RENAME:
@@ -10141,7 +10141,7 @@ void BlueStore::_txc_add_transaction(TransContext *txc, Transaction *t)
              << dendl;
         derr << msg << dendl;
         _dump_transaction<0>(t);
-       ceph_assert(0 == "unexpected error");
+       ceph_abort_msg("unexpected error");
       }
     }
   }
index ae776a099e0807e99f042486a6b791addb0b7702..ff814de5e5c5d02945599aae7cc7629f57b0a3ea 100644 (file)
@@ -1279,7 +1279,7 @@ public:
        break;
       case BUFFER_WARM_OUT:
        // move from warm_out to hot LRU
-       ceph_assert(0 == "this happens via discard hint");
+       ceph_abort_msg("this happens via discard hint");
        break;
       case BUFFER_HOT:
        // move to front of hot LRU
index e3c075bbaf2fa20cb4560444be7467e882f625c9..1d6148bdcadd4fc4fc86dde4eb784de738a9f53b 100644 (file)
@@ -83,7 +83,7 @@ int KernelDevice::open(const string& p)
   dio = true;
   aio = cct->_conf->bdev_aio;
   if (!aio) {
-    ceph_assert(0 == "non-aio not supported");
+    ceph_abort_msg("non-aio not supported");
   }
 
   // disable readahead as it will wreak havoc on our mix of
@@ -430,7 +430,7 @@ void KernelDevice::_aio_thread()
                                         aio, max);
     if (r < 0) {
       derr << __func__ << " got " << cpp_strerror(r) << dendl;
-      ceph_assert(0 == "got unexpected error from io_getevents");
+      ceph_abort_msg("got unexpected error from io_getevents");
     }
     if (r > 0) {
       dout(30) << __func__ << " got " << r << " completed aios" << dendl;
@@ -465,7 +465,7 @@ void KernelDevice::_aio_thread()
         } else if (aio[i]->length != (uint64_t)r) {
           derr << "aio to " << aio[i]->offset << "~" << aio[i]->length
                << " but returned: " << r << dendl;
-          ceph_assert(0 == "unexpected aio error");
+          ceph_abort_msg("unexpected aio error");
         }
 
         dout(10) << __func__ << " finished aio " << aio[i] << " r " << r
@@ -499,7 +499,7 @@ void KernelDevice::_aio_thread()
                 << " since " << debug_stall_since << ", timeout is "
                 << cct->_conf->bdev_debug_aio_suicide_timeout
                 << "s, suicide" << dendl;
-           ceph_assert(0 == "stalled aio... buggy kernel or bad device?");
+           ceph_abort_msg("stalled aio... buggy kernel or bad device?");
          }
        }
       }
index 8597c75022187c8530e59ee864e79fae6898193c..93dbe41de2948e48831519a2d60002e532190813 100644 (file)
@@ -107,9 +107,9 @@ void bluestore_extent_ref_map_t::_check() const
   unsigned refs = 0;
   for (const auto &p : ref_map) {
     if (p.first < pos)
-      ceph_assert(0 == "overlap");
+      ceph_abort_msg("overlap");
     if (p.first == pos && p.second.refs == refs)
-      ceph_assert(0 == "unmerged");
+      ceph_abort_msg("unmerged");
     pos = p.first + p.second.length;
     refs = p.second.refs;
   }
@@ -197,11 +197,11 @@ void bluestore_extent_ref_map_t::put(
   auto p = ref_map.lower_bound(offset);
   if (p == ref_map.end() || p->first > offset) {
     if (p == ref_map.begin()) {
-      ceph_assert(0 == "put on missing extent (nothing before)");
+      ceph_abort_msg("put on missing extent (nothing before)");
     }
     --p;
     if (p->first + p->second.length <= offset) {
-      ceph_assert(0 == "put on missing extent (gap)");
+      ceph_abort_msg("put on missing extent (gap)");
     }
   }
   if (p->first < offset) {
index 405a33bcaaa02ba62f5bafb68ab5738bfe56e069..e83d32622fc992c85cbaa353dd75851cf788bf79 100644 (file)
@@ -601,7 +601,7 @@ public:
       b_len -= p->length;
       ++p;
     }
-    ceph_assert(0 == "we should not get here");
+    ceph_abort_msg("we should not get here");
     return false;
   }
 
@@ -743,7 +743,7 @@ public:
     const char *p = csum_data.c_str();
     switch (cs) {
     case 0:
-      ceph_assert(0 == "no csum data, bad index");
+      ceph_abort_msg("no csum data, bad index");
     case 1:
       return reinterpret_cast<const uint8_t*>(p)[i];
     case 2:
@@ -753,7 +753,7 @@ public:
     case 8:
       return reinterpret_cast<const __le64*>(p)[i];
     default:
-      ceph_assert(0 == "unrecognized csum word size");
+      ceph_abort_msg("unrecognized csum word size");
     }
   }
   const char *get_csum_item_ptr(unsigned i) const {
index 3006cfc28ca62a0ce1738f3ddc29569685e8bc28..cfb1692cf3547461ee898f184f17ef7958fdc702 100644 (file)
@@ -983,7 +983,7 @@ void FileJournal::check_align(off64_t pos, bufferlist& bl)
   if (directio && !bl.is_aligned_size_and_memory(block_size, CEPH_DIRECTIO_ALIGNMENT)) {
     ceph_assert((bl.length() & (CEPH_DIRECTIO_ALIGNMENT - 1)) == 0);
     ceph_assert((pos & (CEPH_DIRECTIO_ALIGNMENT - 1)) == 0);
-    ceph_assert(0 == "bl was not aligned");
+    ceph_abort_msg("bl was not aligned");
   }
 }
 
@@ -1421,7 +1421,7 @@ int FileJournal::write_aio_bl(off64_t& pos, bufferlist& bl, uint64_t seq)
          continue;
        }
        check_align(pos, tbl);
-       ceph_assert(0 == "io_submit got unexpected error");
+       ceph_abort_msg("io_submit got unexpected error");
       } else {
        break;
       }
@@ -1460,7 +1460,7 @@ void FileJournal::write_finish_thread_entry()
        continue;
       }
       derr << "io_getevents got " << cpp_strerror(r) << dendl;
-      ceph_assert(0 == "got unexpected error from io_getevents");
+      ceph_abort_msg("got unexpected error from io_getevents");
     }
 
     {
@@ -1470,7 +1470,7 @@ void FileJournal::write_finish_thread_entry()
        if (event[i].res != ai->len) {
          derr << "aio to " << ai->off << "~" << ai->len
               << " returned: " << (int)event[i].res << dendl;
-         ceph_assert(0 == "unexpected aio error");
+         ceph_abort_msg("unexpected aio error");
        }
        dout(10) << __func__ << " aio " << ai->off
                 << "~" << ai->len << " done" << dendl;
index 3755e4807ffbaeb288a643700bc74a5d9ddc8b1e..43f05f444994a8bd83a718972cb3ae7b1691d6fa 100644 (file)
@@ -2447,12 +2447,12 @@ void FileStore::_set_global_replay_guard(const coll_t& cid,
   int ret = object_map->sync();
   if (ret < 0) {
     derr << __FUNC__ << ": omap sync error " << cpp_strerror(ret) << dendl;
-    ceph_assert(0 == "_set_global_replay_guard failed");
+    ceph_abort_msg("_set_global_replay_guard failed");
   }
   ret = sync_filesystem(basedir_fd);
   if (ret < 0) {
     derr << __FUNC__ << ": sync_filesystem error " << cpp_strerror(ret) << dendl;
-    ceph_assert(0 == "_set_global_replay_guard failed");
+    ceph_abort_msg("_set_global_replay_guard failed");
   }
 
   char fn[PATH_MAX];
@@ -2461,7 +2461,7 @@ void FileStore::_set_global_replay_guard(const coll_t& cid,
   if (fd < 0) {
     int err = errno;
     derr << __FUNC__ << ": " << cid << " error " << cpp_strerror(err) << dendl;
-    ceph_assert(0 == "_set_global_replay_guard failed");
+    ceph_abort_msg("_set_global_replay_guard failed");
   }
 
   _inject_failure();
@@ -2474,7 +2474,7 @@ void FileStore::_set_global_replay_guard(const coll_t& cid,
   if (r < 0) {
     derr << __FUNC__ << ": fsetxattr " << GLOBAL_REPLAY_GUARD_XATTR
         << " got " << cpp_strerror(r) << dendl;
-    ceph_assert(0 == "fsetxattr failed");
+    ceph_abort_msg("fsetxattr failed");
   }
 
   // and make sure our xattr is durable.
@@ -2527,7 +2527,7 @@ void FileStore::_set_replay_guard(const coll_t& cid,
   if (fd < 0) {
     int err = errno;
     derr << __FUNC__ << ": " << cid << " error " << cpp_strerror(err) << dendl;
-    ceph_assert(0 == "_set_replay_guard failed");
+    ceph_abort_msg("_set_replay_guard failed");
   }
   _set_replay_guard(fd, spos, 0, in_progress);
   VOID_TEMP_FAILURE_RETRY(::close(fd));
@@ -2566,7 +2566,7 @@ void FileStore::_set_replay_guard(int fd,
     fd, REPLAY_GUARD_XATTR, v.c_str(), v.length());
   if (r < 0) {
     derr << "fsetxattr " << REPLAY_GUARD_XATTR << " got " << cpp_strerror(r) << dendl;
-    ceph_assert(0 == "fsetxattr failed");
+    ceph_abort_msg("fsetxattr failed");
   }
 
   // and make sure our xattr is durable.
@@ -2586,7 +2586,7 @@ void FileStore::_close_replay_guard(const coll_t& cid,
   if (fd < 0) {
     int err = errno;
     derr << __FUNC__ << ": " << cid << " error " << cpp_strerror(err) << dendl;
-    ceph_assert(0 == "_close_replay_guard failed");
+    ceph_abort_msg("_close_replay_guard failed");
   }
   _close_replay_guard(fd, spos);
   VOID_TEMP_FAILURE_RETRY(::close(fd));
@@ -2616,7 +2616,7 @@ void FileStore::_close_replay_guard(int fd, const SequencerPosition& spos,
     fd, REPLAY_GUARD_XATTR, v.c_str(), v.length());
   if (r < 0) {
     derr << "fsetxattr " << REPLAY_GUARD_XATTR << " got " << cpp_strerror(r) << dendl;
-    ceph_assert(0 == "fsetxattr failed");
+    ceph_abort_msg("fsetxattr failed");
   }
 
   // and make sure our xattr is durable.
@@ -3049,7 +3049,7 @@ void FileStore::_do_transaction(
 
     case Transaction::OP_COLL_SETATTR:
     case Transaction::OP_COLL_RMATTR:
-      ceph_assert(0 == "collection attr methods no longer implemented");
+      ceph_abort_msg("collection attr methods no longer implemented");
       break;
 
     case Transaction::OP_COLL_RENAME:
@@ -3129,7 +3129,7 @@ void FileStore::_do_transaction(
       break;
     case Transaction::OP_SPLIT_COLLECTION:
       {
-       ceph_assert(0 == "not legacy journal; upgrade to firefly first");
+       ceph_abort_msg("not legacy journal; upgrade to firefly first");
       }
       break;
     case Transaction::OP_SPLIT_COLLECTION2:
@@ -3248,7 +3248,7 @@ void FileStore::_do_transaction(
          dump_open_fds(cct);
        }
 
-       ceph_assert(0 == "unexpected error");
+       ceph_abort_msg("unexpected error");
       }
     }
 
@@ -3373,7 +3373,7 @@ int FileStore::read(
     if (errors != 0) {
       dout(0) << __FUNC__ << ": " << cid << "/" << oid << " " << offset << "~"
              << got << " ... BAD CRC:\n" << ss.str() << dendl;
-      ceph_assert(0 == "bad crc on read");
+      ceph_abort_msg("bad crc on read");
     }
   }
 
@@ -4127,7 +4127,7 @@ void FileStore::sync_entry()
        int err = write_op_seq(op_fd, cp);
        if (err < 0) {
          derr << "Error during write_op_seq: " << cpp_strerror(err) << dendl;
-         ceph_assert(0 == "error during write_op_seq");
+         ceph_abort_msg("error during write_op_seq");
        }
 
        char s[NAME_MAX];
@@ -4149,7 +4149,7 @@ void FileStore::sync_entry()
          err = backend->sync_checkpoint(cid);
          if (err < 0) {
            derr << "ioctl WAIT_SYNC got " << cpp_strerror(err) << dendl;
-           ceph_assert(0 == "wait_sync got error");
+           ceph_abort_msg("wait_sync got error");
          }
          dout(20) << " done waiting for checkpoint " << cid << " to complete" << dendl;
        }
@@ -4160,24 +4160,24 @@ void FileStore::sync_entry()
        int err = object_map->sync();
        if (err < 0) {
          derr << "object_map sync got " << cpp_strerror(err) << dendl;
-         ceph_assert(0 == "object_map sync returned error");
+         ceph_abort_msg("object_map sync returned error");
        }
 
        err = backend->syncfs();
        if (err < 0) {
          derr << "syncfs got " << cpp_strerror(err) << dendl;
-         ceph_assert(0 == "syncfs returned error");
+         ceph_abort_msg("syncfs returned error");
        }
 
        err = write_op_seq(op_fd, cp);
        if (err < 0) {
          derr << "Error during write_op_seq: " << cpp_strerror(err) << dendl;
-         ceph_assert(0 == "error during write_op_seq");
+         ceph_abort_msg("error during write_op_seq");
        }
        err = ::fsync(op_fd);
        if (err < 0) {
          derr << "Error during fsync of op_seq: " << cpp_strerror(err) << dendl;
-         ceph_assert(0 == "error during fsync of op_seq");
+         ceph_abort_msg("error during fsync of op_seq");
        }
       }
 
@@ -4912,7 +4912,7 @@ int FileStore::list_collections(vector<coll_t>& ls, bool include_temp)
       if (int n = snprintf(filename, sizeof(filename), "%s/%s", fn, de->d_name);
          n >= static_cast<int>(sizeof(filename))) {
        derr << __func__ << " path length overrun: " << n << dendl;
-       ceph_assert(false);
+       ceph_abort();
       }
 
       r = ::stat(filename, &sb);
@@ -5536,7 +5536,7 @@ int FileStore::_collection_move_rename(const coll_t& oldcid, const ghobject_t& o
                 << oldcid << "/" << oldoid << " (dne, ignoring enoent)"
                 << dendl;
       } else {
-       ceph_assert(0 == "ERROR: source must exist");
+       ceph_abort_msg("ERROR: source must exist");
       }
 
       if (!replaying) {
index 7e2b5728c572c27839c26a388f7ac090981af979..714d0935608ac6d55c383163054c46702798c1de 100644 (file)
@@ -170,7 +170,7 @@ void JournalingObjectStore::SubmitManager::op_submit_finish(uint64_t op)
   if (op != op_submitted + 1) {
     dout(0) << "op_submit_finish " << op << " expected " << (op_submitted + 1)
            << ", OUT OF ORDER" << dendl;
-    ceph_assert(0 == "out of order op_submit_finish");
+    ceph_abort_msg("out of order op_submit_finish");
   }
   op_submitted = op;
   lock.Unlock();
index e2a5d36c7233672db14691576620b41783dbb9da..4ce5256ab7d17ca4b6f5ffe10847d491a5b08c48 100644 (file)
@@ -113,7 +113,7 @@ void WBThrottle::set_from_conf()
     fd_limits.second =
       cct->_conf->filestore_wbthrottle_xfs_inodes_hard_limit;
   } else {
-    ceph_assert(0 == "invalid value for fs");
+    ceph_abort_msg("invalid value for fs");
   }
   cond.Signal();
 }
index aa9ce2502fb0274fda957eb683909f1c387ed6c6..8d63f1d37ad0df0a17cbe5df216dbf19a573a734 100644 (file)
@@ -188,7 +188,7 @@ int chain_getxattr_buf(const char *fn, const char *name, bufferptr *bp)
       }
     }
   }
-  ceph_assert(0 == "unreachable");
+  ceph_abort_msg("unreachable");
   return 0;
 }
 
index a530b54ab11b0deb6d2ea40b492b47b2f719fabe..c40fd0deda3956eeff4bffcb140022fd61c4ac1c 100644 (file)
@@ -113,7 +113,7 @@ int FS::copy_file_range(int to_fd, uint64_t to_offset,
                        int from_fd,
                        uint64_t from_offset, uint64_t from_len)
 {
-  ceph_assert(0 == "write me");
+  ceph_abort_msg("write me");
 }
 
 int FS::zero(int fd, uint64_t offset, uint64_t length)
index ba1a3127adf5aebc633e67e1dd618ced126086ce..b9d7c121d21003727343317665bb0afddf28f735 100644 (file)
@@ -1970,7 +1970,7 @@ void KStore::_txc_state_proc(TransContext *txc)
     default:
       derr << __func__ << " unexpected txc " << txc
           << " state " << txc->get_state_name() << dendl;
-      ceph_assert(0 == "unexpected txc state");
+      ceph_abort_msg("unexpected txc state");
       return;
     }
   }
@@ -2231,7 +2231,7 @@ void KStore::_txc_add_transaction(TransContext *txc, Transaction *t)
       break;
 
     case Transaction::OP_SPLIT_COLLECTION:
-      ceph_assert(0 == "deprecated");
+      ceph_abort_msg("deprecated");
       break;
 
     case Transaction::OP_SPLIT_COLLECTION2:
@@ -2275,7 +2275,7 @@ void KStore::_txc_add_transaction(TransContext *txc, Transaction *t)
       break;
 
     case Transaction::OP_COLL_RENAME:
-      ceph_assert(0 == "not implemented");
+      ceph_abort_msg("not implemented");
       break;
     }
     if (r < 0) {
@@ -2289,7 +2289,7 @@ void KStore::_txc_add_transaction(TransContext *txc, Transaction *t)
       f.close_section();
       f.flush(*_dout);
       *_dout << dendl;
-      ceph_assert(0 == "unexpected error");
+      ceph_abort_msg("unexpected error");
     }
 
     // object operations
@@ -2397,7 +2397,7 @@ void KStore::_txc_add_transaction(TransContext *txc, Transaction *t)
       break;
 
     case Transaction::OP_CLONERANGE:
-      ceph_assert(0 == "deprecated");
+      ceph_abort_msg("deprecated");
       break;
 
     case Transaction::OP_CLONERANGE2:
@@ -2412,15 +2412,15 @@ void KStore::_txc_add_transaction(TransContext *txc, Transaction *t)
       break;
 
     case Transaction::OP_COLL_ADD:
-      ceph_assert(0 == "not implemented");
+      ceph_abort_msg("not implemented");
       break;
 
     case Transaction::OP_COLL_REMOVE:
-      ceph_assert(0 == "not implemented");
+      ceph_abort_msg("not implemented");
       break;
 
     case Transaction::OP_COLL_MOVE:
-      ceph_assert(0 == "deprecated");
+      ceph_abort_msg("deprecated");
       break;
 
     case Transaction::OP_COLL_MOVE_RENAME:
@@ -2536,7 +2536,7 @@ void KStore::_txc_add_transaction(TransContext *txc, Transaction *t)
        f.close_section();
        f.flush(*_dout);
        *_dout << dendl;
-       ceph_assert(0 == "unexpected error");
+       ceph_abort_msg("unexpected error");
       }
     }
   }
index ca384b8c7609ffe8a63daebfce7564720e88994e..199af45ab6a4a2a0f6c1ba28e79d4b9f4dedb6e8 100644 (file)
@@ -840,7 +840,7 @@ void MemStore::_do_transaction(Transaction& t)
       break;
 
     case Transaction::OP_COLL_MOVE:
-      ceph_assert(0 == "deprecated");
+      ceph_abort_msg("deprecated");
       break;
 
     case Transaction::OP_COLL_MOVE_RENAME:
@@ -868,19 +868,19 @@ void MemStore::_do_transaction(Transaction& t)
 
     case Transaction::OP_COLL_SETATTR:
       {
-       ceph_assert(0 == "not implemented");
+       ceph_abort_msg("not implemented");
       }
       break;
 
     case Transaction::OP_COLL_RMATTR:
       {
-       ceph_assert(0 == "not implemented");
+       ceph_abort_msg("not implemented");
       }
       break;
 
     case Transaction::OP_COLL_RENAME:
       {
-       ceph_assert(0 == "not implemented");
+       ceph_abort_msg("not implemented");
       }
       break;
 
@@ -929,7 +929,7 @@ void MemStore::_do_transaction(Transaction& t)
       }
       break;
     case Transaction::OP_SPLIT_COLLECTION:
-      ceph_assert(0 == "deprecated");
+      ceph_abort_msg("deprecated");
       break;
     case Transaction::OP_SPLIT_COLLECTION2:
       {
@@ -992,7 +992,7 @@ void MemStore::_do_transaction(Transaction& t)
        f.close_section();
        f.flush(*_dout);
        *_dout << dendl;
-       ceph_assert(0 == "unexpected error");
+       ceph_abort_msg("unexpected error");
       }
     }
 
index eba12bec677486c7aae6c344a008cae14fa8b8b9..9288bd94f4cdf1d2638a818b5e1a55b261753418 100644 (file)
@@ -46,7 +46,7 @@ ostream &operator<<(ostream &lhs, const ECBackend::pipeline_state_t &rhs) {
   case ECBackend::pipeline_state_t::CACHE_INVALID:
     return lhs << "CACHE_INVALID";
   default:
-    ceph_assert(0 == "invalid pipeline state");
+    ceph_abort_msg("invalid pipeline state");
   }
   return lhs; // unreachable
 }
@@ -726,7 +726,7 @@ int ECBackend::recover_object(
       ceph_assert(head->ssc);
       h->ops.back().recovery_info.ss = head->ssc->snapset;
     } else {
-      ceph_assert(0 == "neither obc nor head set for a snap object");
+      ceph_abort_msg("neither obc nor head set for a snap object");
     }
   }
   h->ops.back().recovery_progress.omap_complete = true;
index 7e9ef685648e04e6fb52cc030783de9af6ebe7cc..f5a47e3b0648655f34a5d738460a537e74752c87 100644 (file)
@@ -524,7 +524,7 @@ void OSDService::agent_stop()
     if (!agent_queue.empty()) {
       set<PGRef>& top = agent_queue.rbegin()->second;
       derr << "agent queue not empty, for example " << (*top.begin())->get_pgid() << dendl;
-      ceph_assert(0 == "agent queue not empty");
+      ceph_abort_msg("agent queue not empty");
     }
 
     agent_stop_flag = true;
@@ -2253,7 +2253,7 @@ will start to track new ops received afterwards.";
     }
     f->close_section();
   } else {
-    ceph_assert(0 == "broken asok registration");
+    ceph_abort_msg("broken asok registration");
   }
   f->flush(ss);
   delete f;
@@ -3850,7 +3850,7 @@ void OSD::load_pgs()
          derr << __func__ << ": have pgid " << pgid << " at epoch "
               << map_epoch << ", but missing map.  Crashing."
               << dendl;
-         ceph_assert(0 == "Missing map in load_pgs");
+         ceph_abort_msg("Missing map in load_pgs");
        }
       }
       pg = _make_pg(pgosdmap, pgid);
@@ -7342,7 +7342,7 @@ void OSD::handle_osd_map(MOSDMap *m)
       inc.decode(p);
       if (o->apply_incremental(inc) < 0) {
        derr << "ERROR: bad fsid?  i have " << osdmap->get_fsid() << " and inc has " << inc.fsid << dendl;
-       ceph_assert(0 == "bad fsid");
+       ceph_abort_msg("bad fsid");
       }
 
       bufferlist fbl;
@@ -7377,7 +7377,7 @@ void OSD::handle_osd_map(MOSDMap *m)
       continue;
     }
 
-    ceph_assert(0 == "MOSDMap lied about what maps it had?");
+    ceph_abort_msg("MOSDMap lied about what maps it had?");
   }
 
   // even if this map isn't from a mon, we may have satisfied our subscription
index 89fcf4cc1792db9bafd424def51e2ebcf1e6293a..2c96b7068b6497147ab5213f7d807093e7b90c85 100644 (file)
@@ -4029,7 +4029,7 @@ int OSDMap::summarize_mapping_stats(
            }
          }
        } else {
-         ceph_assert(0 == "unhandled pool type");
+         ceph_abort_msg("unhandled pool type");
        }
       }
     }
index 00448f6bf98d770401c039fbe5f2aaf89efe2ce8..cc6845678dd1712423af66c8521c5f7abdbb3ffc 100644 (file)
@@ -929,7 +929,7 @@ void PG::check_past_interval_bounds() const
       derr << info.pgid << " past_intervals [" << apib
           << ") start interval does not contain the required"
           << " bound [" << rpib << ") start" << dendl;
-      ceph_assert(0 == "past_interval start interval mismatch");
+      ceph_abort_msg("past_interval start interval mismatch");
     }
     if (apib.second != rpib.second) {
       osd->clog->error() << info.pgid << " past_interal bound [" << apib
@@ -938,7 +938,7 @@ void PG::check_past_interval_bounds() const
       derr << info.pgid << " past_interal bound [" << apib
           << ") end does not match required [" << rpib
           << ") end" << dendl;
-      ceph_assert(0 == "past_interval end mismatch");
+      ceph_abort_msg("past_interval end mismatch");
     }
   }
 }
@@ -3738,7 +3738,7 @@ void PG::read_state(ObjectStore *store)
   if (info_struct_v < compat_struct_v) {
     derr << "PG needs upgrade, but on-disk data is too old; upgrade to"
         << " an older version first." << dendl;
-    ceph_assert(0 == "PG too old to upgrade");
+    ceph_abort_msg("PG too old to upgrade");
   }
 
   last_written_info = info;
@@ -4622,7 +4622,7 @@ void PG::repair_object(
     decode(oi, bliter);
   } catch (...) {
     dout(0) << __func__ << ": Need version of replica, bad object_info_t: " << soid << dendl;
-    ceph_assert(0);
+    ceph_abort();
   }
   if (bad_peer != primary) {
     peer_missing[bad_peer].add(soid, oi.version, eversion_t(), false);
@@ -6608,7 +6608,7 @@ PG::RecoveryState::Crashed::Crashed(my_context ctx)
     NamedState(context< RecoveryMachine >().pg, "Crashed")
 {
   context< RecoveryMachine >().log_enter(state_name);
-  ceph_assert(0 == "we got a bad state machine event");
+  ceph_abort_msg("we got a bad state machine event");
 }
 
 
index de85388750a3817390ca36155fa810d580255dbb..2c1c79444f8f7bf8064c01226f83de279075e2ae 100644 (file)
@@ -299,7 +299,7 @@ public:
            return true;
          }
        }
-       ceph_assert(0 == "in extra_caller_ops but not extra_reqids");
+       ceph_abort_msg("in extra_caller_ops but not extra_reqids");
       }
 
       if (!(indexed_data & PGLOG_INDEXED_DUPS)) {
@@ -1440,7 +1440,7 @@ public:
                                << i.first << " " << i.second
                                << " last_backfill = " << info.last_backfill
                                << dendl;
-             ceph_assert(0 == "invalid missing set entry found");
+             ceph_abort_msg("invalid missing set entry found");
            }
            bufferlist bv;
            int r = store->getattr(
index 4c1f8307ead5d4f0b80f677a7520057ec785db1a..e3a7b8e1e8206e6b7cf561b9587f33000065f581 100644 (file)
@@ -234,7 +234,7 @@ public:
            return BufferUpdate::Zero{z.len + r->len};
          },
          [&](const BufferUpdate::CloneRange &c) -> BufferUpdateType {
-           ceph_assert(0 == "violates can_merge condition");
+           ceph_abort_msg("violates can_merge condition");
            return left;
          });
       }
index 29869c0e19e02fe3fe0075a4058f1f6fd7f1d13b..0ef84b73747bdff62bb69923f60c67c96d6f1fd5 100644 (file)
@@ -1874,7 +1874,7 @@ void PrimaryLogPG::do_request(
     break;
 
   default:
-    ceph_assert(0 == "bad message type in do_request");
+    ceph_abort_msg("bad message type in do_request");
   }
 }
 
@@ -2491,7 +2491,7 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_manifest_detail(
       return cache_result_t::NOOP;
     }
   default:
-    ceph_assert(0 == "unrecognized manifest type");
+    ceph_abort_msg("unrecognized manifest type");
   }
 
   return cache_result_t::NOOP;
@@ -2830,7 +2830,7 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_cache_detail(
 
       return cache_result_t::HANDLED_PROXY;
     }
-    ceph_assert(0 == "unreachable");
+    ceph_abort_msg("unreachable");
     return cache_result_t::NOOP;
 
   case pg_pool_t::CACHEMODE_FORWARD:
@@ -2907,7 +2907,7 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_cache_detail(
     return cache_result_t::HANDLED_PROXY;
 
   default:
-    ceph_assert(0 == "unrecognized cache_mode");
+    ceph_abort_msg("unrecognized cache_mode");
   }
   return cache_result_t::NOOP;
 }
@@ -3082,7 +3082,7 @@ void PrimaryLogPG::do_proxy_read(OpRequestRef op, ObjectContextRef obc)
          soid = obc->obs.oi.manifest.redirect_target;  
          break;
       default:
-       ceph_assert(0 == "unrecognized manifest type");
+       ceph_abort_msg("unrecognized manifest type");
     }
   } else {
   /* proxy */
@@ -3297,7 +3297,7 @@ void PrimaryLogPG::do_proxy_write(OpRequestRef op, ObjectContextRef obc)
          soid = obc->obs.oi.manifest.redirect_target;  
          break;
       default:
-       ceph_assert(0 == "unrecognized manifest type");
+       ceph_abort_msg("unrecognized manifest type");
     }
   } else {
   /* proxy */
@@ -3510,7 +3510,7 @@ void PrimaryLogPG::do_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc,
   if (chunk_index <= req_offset) {
     osd_op.op.extent.offset = manifest->chunk_map[chunk_index].offset + req_offset - chunk_index;
   } else {
-    ceph_assert(0 == "chunk_index > req_offset");
+    ceph_abort_msg("chunk_index > req_offset");
   } 
   osd_op.op.extent.length = req_length; 
 
@@ -3728,7 +3728,7 @@ struct PromoteFinisher : public PrimaryLogPG::OpFinisher {
                                                promote_callback->promote_results.get<1>(),
                                                promote_callback->obc);
     } else {
-      ceph_assert(0 == "unrecognized manifest type");
+      ceph_abort_msg("unrecognized manifest type");
     }
     return 0;
   }
@@ -3791,7 +3791,7 @@ void PrimaryLogPG::promote_object(ObjectContextRef obc,
       src_hoid = obc->obs.oi.manifest.redirect_target;
       cb = new PromoteCallback(obc, this);
     } else {
-      ceph_assert(0 == "unrecognized manifest type");
+      ceph_abort_msg("unrecognized manifest type");
     }
   }
 
@@ -3950,7 +3950,7 @@ void PrimaryLogPG::execute_ctx(OpContext *ctx)
       dout(20) << " op order client." << n << " tid " << t << " last was " << p->second << dendl;
       if (p->second > t) {
        derr << "bad op order, already applied " << p->second << " > this " << t << dendl;
-       ceph_assert(0 == "out of order op");
+       ceph_abort_msg("out of order op");
       }
       p->second = t;
     }
@@ -6973,7 +6973,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
            src_hoid = obs.oi.manifest.redirect_target;
            cb = new PromoteManifestCallback(ctx->obc, this, ctx);
          } else {
-           ceph_assert(0 == "unrecognized manifest type");
+           ceph_abort_msg("unrecognized manifest type");
          }
           ctx->op_finishers[ctx->current_osd_subop_num].reset(
             new PromoteFinisher(cb));
@@ -7038,7 +7038,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
              }
            });
        } else {
-         ceph_assert(0 == "unrecognized manifest type");
+         ceph_abort_msg("unrecognized manifest type");
        }
 
        oi.clear_flag(object_info_t::FLAG_MANIFEST);
@@ -7839,9 +7839,9 @@ int PrimaryLogPG::_rollback_to(OpContext *ctx, ceph_osd_op& op)
       block_write_on_full_cache(soid, ctx->op);
       return -EAGAIN;
     case cache_result_t::REPLIED_WITH_EAGAIN:
-      ceph_assert(0 == "this can't happen, no rollback on replica");
+      ceph_abort_msg("this can't happen, no rollback on replica");
     default:
-      ceph_assert(0 == "must promote was set, other values are not valid");
+      ceph_abort_msg("must promote was set, other values are not valid");
       return -EAGAIN;
     }
   }
@@ -7860,7 +7860,7 @@ int PrimaryLogPG::_rollback_to(OpContext *ctx, ceph_osd_op& op)
     }
   } else if (ret) {
     // ummm....huh? It *can't* return anything else at time of writing.
-    ceph_assert(0 == "unexpected error code in _rollback_to");
+    ceph_abort_msg("unexpected error code in _rollback_to");
   } else { //we got our context, let's use it to do the rollback!
     hobject_t& rollback_to_sobject = rollback_to->obs.oi.soid;
     if (is_degraded_or_backfilling_object(rollback_to_sobject) ||
@@ -8810,7 +8810,7 @@ void PrimaryLogPG::start_copy(CopyCallback *cb, ObjectContextRef obc,
       auto p = obc->obs.oi.manifest.chunk_map.begin();
       _copy_some_manifest(obc, cop, p->first);
     } else {
-      ceph_assert(0 == "unrecognized manifest type");
+      ceph_abort_msg("unrecognized manifest type");
     }
   }
 }
@@ -9517,7 +9517,7 @@ void PrimaryLogPG::finish_promote(int r, CopyResults *results,
     if (!tctx->lock_manager.take_write_lock(
          head,
          obc)) {
-      ceph_assert(0 == "problem!");
+      ceph_abort_msg("problem!");
     }
     dout(20) << __func__ << " took lock on obc, " << obc->rwstate << dendl;
 
@@ -9623,7 +9623,7 @@ void PrimaryLogPG::finish_promote(int r, CopyResults *results,
   if (!tctx->lock_manager.take_write_lock(
        obc->obs.oi.soid,
        obc)) {
-    ceph_assert(0 == "problem!");
+    ceph_abort_msg("problem!");
   }
   dout(20) << __func__ << " took lock on obc, " << obc->rwstate << dendl;
 
@@ -11692,7 +11692,7 @@ void PrimaryLogPG::mark_all_unfound_lost(
 
     switch (what) {
     case pg_log_entry_t::LOST_MARK:
-      ceph_assert(0 == "actually, not implemented yet!");
+      ceph_abort_msg("actually, not implemented yet!");
       break;
 
     case pg_log_entry_t::LOST_REVERT:
@@ -13292,7 +13292,7 @@ void PrimaryLogPG::update_range(
     projected_log.scan_log_after(bi->version, func);
     bi->version = projected_last_update;
   } else {
-    ceph_assert(0 == "scan_range should have raised bi->version past log_tail");
+    ceph_abort_msg("scan_range should have raised bi->version past log_tail");
   }
 }
 
@@ -13372,7 +13372,7 @@ void PrimaryLogPG::check_local()
       if (r != -ENOENT) {
        derr << __func__ << " " << p->soid << " exists, but should have been "
             << "deleted" << dendl;
-       ceph_assert(0 == "erroneously present object");
+       ceph_abort_msg("erroneously present object");
       }
     } else {
       // ignore old(+missing) objects
@@ -15180,7 +15180,7 @@ boost::statechart::result PrimaryLogPG::AwaitAsyncWork::react(const DoSnapWork&)
   if (r != 0 && r != -ENOENT) {
     lderr(pg->cct) << "get_next_objects_to_trim returned "
                   << cpp_strerror(r) << dendl;
-    ceph_assert(0 == "get_next_objects_to_trim returned an invalid code");
+    ceph_abort_msg("get_next_objects_to_trim returned an invalid code");
   } else if (r == -ENOENT) {
     // Done!
     ldout(pg->cct, 10) << "got ENOENT" << dendl;
index 0b20d9ca5e037601d15e198658c357afa0c5b532..76546ea391fa566a337a7aa461b7e928505fd690 100644 (file)
@@ -93,7 +93,7 @@ static void log_subop_stats(
       logger->inc(l_osd_sop_push_inb, inb);
       logger->tinc(l_osd_sop_push_lat, latency);
     } else
-      ceph_assert("no support subop" == 0);
+      ceph_abort_msg("no support subop");
   } else {
     logger->tinc(l_osd_sop_pull_lat, latency);
   }
@@ -261,7 +261,7 @@ void ReplicatedBackend::objects_read_async(
   Context *on_complete,
   bool fast_read)
 {
-  ceph_assert(0 == "async read is not used by replica pool");
+  ceph_abort_msg("async read is not used by replica pool");
 }
 
 class C_OSD_OnOpCommit : public Context {
index 5372685b78e83c49a250659db24c4f17a3f5381d..2c58534b1c2da6a2c7cb2dd12a4fde9201b9a7d4 100644 (file)
@@ -42,7 +42,7 @@ struct TierAgentState {
     case FLUSH_MODE_IDLE: return "idle";
     case FLUSH_MODE_LOW: return "low";
     case FLUSH_MODE_HIGH: return "high";
-    default: ceph_assert(0 == "bad flush mode");
+    default: ceph_abort_msg("bad flush mode");
     }
   }
   const char *get_flush_mode_name() const {
@@ -59,7 +59,7 @@ struct TierAgentState {
     case EVICT_MODE_IDLE: return "idle";
     case EVICT_MODE_SOME: return "some";
     case EVICT_MODE_FULL: return "full";
-    default: ceph_assert(0 == "bad evict mode");
+    default: ceph_abort_msg("bad evict mode");
     }
   }
   const char *get_evict_mode_name() const {
index 775cdf7a646ce55a8998ef7f6c0e605cda7cafb6..97d444e7ea74b3862636eed50c32fd67a1516e10 100644 (file)
@@ -116,7 +116,7 @@ public:
       case RWEXCL:
        return false;
       default:
-       ceph_assert(0 == "unhandled case");
+       ceph_abort_msg("unhandled case");
        return false;
       }
     }
@@ -150,7 +150,7 @@ public:
       case RWEXCL:
        return false;
       default:
-       ceph_assert(0 == "unhandled case");
+       ceph_abort_msg("unhandled case");
        return false;
       }
     }
@@ -168,7 +168,7 @@ public:
       case RWEXCL:
        return false;
       default:
-       ceph_assert(0 == "unhandled case");
+       ceph_abort_msg("unhandled case");
        return false;
       }
     }
@@ -230,7 +230,7 @@ public:
     case RWState::RWEXCL:
       return get_excl(op);
     default:
-      ceph_assert(0 == "invalid lock type");
+      ceph_abort_msg("invalid lock type");
       return true;
     }
   }
@@ -277,7 +277,7 @@ public:
       rwstate.put_excl(to_wake);
       break;
     default:
-      ceph_assert(0 == "invalid lock type");
+      ceph_abort_msg("invalid lock type");
     }
     if (rwstate.empty() && rwstate.recovery_read_marker) {
       rwstate.recovery_read_marker = false;
index 93aa37f4e448bcdd1ed7bc75ea9f03a9ebef6e85..fc30e99bf17d95507e240ff802ac84ab95e02b00 100644 (file)
@@ -640,7 +640,7 @@ void coll_t::calc_str()
     _str = pgid.calc_name(_str_buff + spg_t::calc_name_buf_size - 1, "PMET_");
     break;
   default:
-    ceph_assert(0 == "unknown collection type");
+    ceph_abort_msg("unknown collection type");
   }
 }
 
@@ -3322,7 +3322,7 @@ void PastIntervals::decode(bufferlist::const_iterator &bl)
   case 0:
     break;
   case 1:
-    ceph_assert(0 == "pi_simple_rep support removed post-luminous");
+    ceph_abort_msg("pi_simple_rep support removed post-luminous");
     break;
   case 2:
     past_intervals.reset(new pi_compact_rep);
@@ -3745,12 +3745,12 @@ void ObjectModDesc::visit(Visitor *visitor) const
        break;
       }
       default:
-       ceph_assert(0 == "Invalid rollback code");
+       ceph_abort_msg("Invalid rollback code");
       }
       DECODE_FINISH(bp);
     }
   } catch (...) {
-    ceph_assert(0 == "Invalid encoding");
+    ceph_abort_msg("Invalid encoding");
   }
 }
 
index 4156718b86ff7595f23f17b43bda0af5b4bf61b6..455ff56d359ca1e525189ce46a2775e1a4226570 100644 (file)
@@ -1305,7 +1305,7 @@ struct pg_pool_t {
     case CACHEMODE_READPROXY:
       return true;
     default:
-      ceph_assert(0 == "implement me");
+      ceph_abort_msg("implement me");
     }
   }
 
@@ -1532,7 +1532,7 @@ public:
     case TYPE_ERASURE:
       return false;
     default:
-      ceph_assert(0 == "unhandled pool type");
+      ceph_abort_msg("unhandled pool type");
     }
   }
 
@@ -2693,7 +2693,7 @@ public:
     virtual void iterate_all_intervals(
       std::function<void(const pg_interval_t &)> &&f) const {
       ceph_assert(!has_full_intervals());
-      ceph_assert(0 == "not valid for this implementation");
+      ceph_abort_msg("not valid for this implementation");
     }
 
     virtual ~interval_rep() {}
index 7a80953e6b665debe56d671c0a90d3c7c4a6cc52..fe25e5c70e5a9cb9e69d9741fc2635dd2d79383d 100644 (file)
@@ -1392,7 +1392,7 @@ void Journaler::handle_write_error(int r)
     lderr(cct) << __func__ << ": multiple write errors, handler already called"
               << dendl;
   } else {
-    ceph_assert(0 == "unhandled write error");
+    ceph_abort_msg("unhandled write error");
   }
 }
 
index 3c2f0d3038ee4bf413cb7089c3659a8217e8399e..c67b5f1c1a8c19eec964ae35f09131eb9475d2f3 100644 (file)
@@ -2631,7 +2631,7 @@ void ObjectCacher::bh_stat_add(BufferHead *bh)
     stat_error += bh->length();
     break;
   default:
-    ceph_assert(0 == "bh_stat_add: invalid bufferhead state");
+    ceph_abort_msg("bh_stat_add: invalid bufferhead state");
   }
   if (get_stat_dirty_waiting() > 0)
     stat_cond.Signal();
@@ -2667,7 +2667,7 @@ void ObjectCacher::bh_stat_sub(BufferHead *bh)
     stat_error -= bh->length();
     break;
   default:
-    ceph_assert(0 == "bh_stat_sub: invalid bufferhead state");
+    ceph_abort_msg("bh_stat_sub: invalid bufferhead state");
   }
 }
 
index 9c5e1c132342376fecf524a17a475f829825f096..c188852dca0bedd8fbf322f910bdfa412e56e03d 100644 (file)
@@ -21,7 +21,8 @@
 #include <array>
 #include <atomic>
 #include <memory>
-#include <cassert>
+
+#include "include/assert.h"
 
 class PerfHistogramCommon {
 public:
@@ -79,9 +80,10 @@ public:
 
     int i = 0;
     for (const auto &ac : axes_config) {
-      ceph_assert(ac.m_buckets > 0 && "Must have at least one bucket on axis");
-      ceph_assert(ac.m_quant_size > 0 &&
-             "Quantization unit must be non-zero positive integer value");
+      ceph_assertf(ac.m_buckets > 0,
+                  "Must have at least one bucket on axis");
+      ceph_assertf(ac.m_quant_size > 0,
+                  "Quantization unit must be non-zero positive integer value");
 
       m_axes_config[i++] = ac;
     }
@@ -178,8 +180,8 @@ protected:
     static_assert(sizeof...(T) == DIM, "Incorrect number of arguments");
     return get_raw_index_internal<0>(
         [](int64_t bucket, const axis_config_d &ac) {
-          ceph_assert(bucket >= 0 && "Bucket index can not be negative");
-          ceph_assert(bucket < ac.m_buckets && "Bucket index too large");
+          ceph_assertf(bucket >= 0, "Bucket index can not be negative");
+          ceph_assertf(bucket < ac.m_buckets, "Bucket index too large");
           return bucket;
         },
         0, buckets...);
index 7e6651a7c0a07a4cbd51f23ce9a43396886aef3c..1302391c9cb3a2b46079bcb26fe2147d308056d5 100644 (file)
@@ -112,7 +112,7 @@ AdminSocketOutput::run_command(AdminSocketClient &client,
   if (!err.empty()) {
     std::cerr << __func__  << " AdminSocketClient::do_request errored with: "
               << err << std::endl;
-    ceph_assert(false);
+    ceph_abort();
   }
   return std::make_pair(command, output);
 }
index 21eb62550aabf6f6874633829970befb214a2c71..48103ab996acad965947893858781a2d330ad828 100644 (file)
@@ -47,7 +47,7 @@ public:
        g_conf().set_val("compressor_zlib_isal", "false");
        g_ceph_context->_conf.apply_changes(nullptr);
       } else {
-       ceph_assert(0 == "bad option");
+       ceph_abort_msg("bad option");
       }
     }
     cout << "[plugin " << plugin << " (" << GetParam() << ")]" << std::endl;
index 4c0d1c4922a64cd992f7e6c179de571beab4a3b4..2dc3b970213aba3d2f6ccfd71819690e85d6d078 100644 (file)
@@ -134,7 +134,7 @@ static void namespace_breaker_func(struct ceph_mount_info *cmount, int cmd, cons
       break;
     default:
       // Bad command
-      ceph_assert(false);
+      ceph_abort();
     }
     if (ret != -EAGAIN)
       break;
index 0399fcd1480b6ba339455df84c1749ad792578e5..b943f81c47ea11483a2deb7dec3a8e6115328a03 100644 (file)
@@ -106,11 +106,11 @@ struct GetLockerRequest<MockManagedLockImageCtx> {
   static GetLockerRequest* create(librados::IoCtx& ioctx,
                                   const std::string& oid, bool exclusive,
                                   Locker *locker, Context *on_finish) {
-    ceph_assert(0 == "unexpected call");
+    ceph_abort_msg("unexpected call");
   }
 
   void send() {
-    ceph_assert(0 == "unexpected call");
+    ceph_abort_msg("unexpected call");
   }
 };
 
@@ -121,11 +121,11 @@ struct BreakRequest<MockManagedLockImageCtx> {
                               bool exclusive, bool blacklist_locker,
                               uint32_t blacklist_expire_seconds,
                               bool force_break_lock, Context *on_finish) {
-    ceph_assert(0 == "unexpected call");
+    ceph_abort_msg("unexpected call");
   }
 
   void send() {
-    ceph_assert(0 == "unexpected call");
+    ceph_abort_msg("unexpected call");
   }
 };
 
index 92f16462c448c152489f8287b50ab6ab6a48f16b..772bc5def530025c7b91ed99d4221e41d49c95f6 100644 (file)
@@ -556,7 +556,7 @@ class OSDStub : public TestStub
       if (pgs.count(pgid) == 0) {
        derr << __func__
             << " pgid " << pgid << " not on our map" << dendl;
-       ceph_assert(0 == "pgid not on our map");
+       ceph_abort_msg("pgid not on our map");
       }
       pg_stat_t &s = pgs[pgid];
       mstats->pg_stat[pgid] = s;
@@ -847,7 +847,7 @@ class OSDStub : public TestStub
        derr << "osd." << whoami << "::" << __func__
             << "** ERROR: applying incremental: "
             << cpp_strerror(err) << dendl;
-       ceph_assert(0 == "error applying incremental");
+       ceph_abort_msg("error applying incremental");
       }
     }
     dout(30) << __func__ << "\nosdmap:\n";
index 667f165e67e337379636756e84e8e1d992586197..facf50d1339596b822d2d08c76c925cbd6c46bbd 100644 (file)
@@ -1159,7 +1159,7 @@ class SyntheticWorkload {
       if (i++ % 50 == 0)
         print_internal_state(true);
       if (timeout_us < 0)
-        ceph_assert(0 == " loop time exceed 5 mins, it looks we stuck into some problems!");
+        ceph_abort_msg(" loop time exceed 5 mins, it looks we stuck into some problems!");
     }
     for (set<Messenger*>::iterator it = available_servers.begin();
          it != available_servers.end(); ++it) {
index ddff7a0170606035e14498c49f990656697645bc..7a2bc9b6e513c5bd9cc72db72afad097eb9b0281 100644 (file)
@@ -79,7 +79,7 @@ bool DeterministicOpSequence::run_one_op(int op, rngen_t& gen)
 
   default:
     cout << "bad op " << op << std::endl;
-    ceph_assert(0 == "bad op");
+    ceph_abort_msg("bad op");
   }
   return ok;
 }
index 52d2ab60b7da728cd97826308835e97220d1bbef..19043856d5bae1c502fc042b344e7012da20c177 100644 (file)
@@ -293,5 +293,5 @@ int TestObjectStoreState::coll_entry_t::get_random_obj_id(rngen_t& gen)
       return it->first;
     }
   }
-  ceph_assert(0 == "INTERNAL ERROR");
+  ceph_abort_msg("INTERNAL ERROR");
 }
index 7213867192be52aed20ece3557d5f186c2725f74..fa6c0816d045a5e27349af6464193d5a2b5008fe 100644 (file)
@@ -4171,7 +4171,7 @@ public:
          cerr << "- " << *p << std::endl;
       //cerr << " objects_set: " << objects_set << std::endl;
       //cerr << " available_set: " << available_objects << std::endl;
-      ceph_assert(0 == "badness");
+      ceph_abort_msg("badness");
     }
 
     ASSERT_EQ(objects_set.size(), available_objects.size());
index 11eab51ce7b0a375cb2fd7b6592bae471af0062f..43dd2ae4de01f2bfd30ed939707a91dfb89b7f62 100644 (file)
@@ -929,7 +929,7 @@ public:
        cerr << "Error: racing read on " << oid << " returned version "
             << rcompletion->get_version64() << " rather than version "
             << version << std::endl;
-       ceph_assert(0 == "racing read got wrong version");
+       ceph_abort_msg("racing read got wrong version");
       }
 
       {
@@ -1106,7 +1106,7 @@ public:
        cerr << "Error: racing read on " << oid << " returned version "
             << rcompletion->get_version64() << " rather than version "
             << version << std::endl;
-       ceph_assert(0 == "racing read got wrong version");
+       ceph_abort_msg("racing read got wrong version");
       }
 
       {
@@ -1412,7 +1412,7 @@ public:
       }
       if (old_value.deleted()) {
        std::cout << num << ":  expect deleted" << std::endl;
-       ceph_assert(0 == "expected deleted");
+       ceph_abort_msg("expected deleted");
       } else {
        std::cout << num << ":  expect " << old_value.most_recent() << std::endl;
       }
@@ -2162,7 +2162,7 @@ public:
     if (!retval) {
       if (old_value.deleted()) {
        std::cout << num << ":  expect deleted" << std::endl;
-       ceph_assert(0 == "expected deleted");
+       ceph_abort_msg("expected deleted");
       } else {
        std::cout << num << ":  expect " << old_value.most_recent() << std::endl;
       }
@@ -2673,7 +2673,7 @@ public:
     if (r == 0) {
       // sucess
     } else {
-      ceph_assert(0 == "shouldn't happen");
+      ceph_abort_msg("shouldn't happen");
     }
     context->update_object_version(oid, completion->get_version64());
     context->find_object(oid, &oid_value);
@@ -3013,7 +3013,7 @@ public:
     } else if (r == -ENOENT) {
       // may have raced with a remove?
     } else {
-      ceph_assert(0 == "shouldn't happen");
+      ceph_abort_msg("shouldn't happen");
     }
     context->kick();
     done = true;
@@ -3099,7 +3099,7 @@ public:
     } else if (r == -ENOENT) {
       // may have raced with a remove?
     } else {
-      ceph_assert(0 == "shouldn't happen");
+      ceph_abort_msg("shouldn't happen");
     }
     context->kick();
     done = true;
index ad2f983401bafa95b44768962031363c20b23ff7..4535ab7a59e28e5c8b8e8e93bacde4542ccd6ff5 100644 (file)
@@ -29,7 +29,7 @@ public:
     if (policy_type == "none" || policy_type == "simple") {
       m_policy = image_map::SimplePolicy::create(m_local_io_ctx);
     } else {
-      ceph_assert(false);
+      ceph_abort();
     }
 
     m_policy->init({});
index 6e40d0a362a83ec734d28e30d44dd3dd4aa32333..42bd584b629e8a62825dccedd2d96168d8270c0f 100644 (file)
@@ -70,7 +70,7 @@ void testhandler(int signal)
     usr2 = true;
     break;
   default:
-    ceph_assert(0 == "unexpected signal");
+    ceph_abort_msg("unexpected signal");
   }
 }
 
index 74137de7c11387163f928b99640e3178f9388e2c..8d7ca5d9bd1c3d2d7fad609b36d41d3a55d2e75b 100644 (file)
@@ -111,7 +111,7 @@ const DeviceOperations *get_device_operations(const po::variables_map &vm) {
   case DEVICE_TYPE_NBD:
     return &nbd_operations;
   default:
-    ceph_assert(0);
+    ceph_abort();
     return nullptr;
   }
 }
index 568f425940f2b823fb7dbe04f67f683aa9299454..58fa5e03040ca217a1d428e5d4fc059e6dcec4af 100644 (file)
@@ -529,7 +529,7 @@ void ImageMap<I>::init(Context *on_finish) {
   if (policy_type == "none" || policy_type == "simple") {
     m_policy.reset(image_map::SimplePolicy::create(m_ioctx));
   } else {
-    ceph_assert(false); // not really needed as such, but catch it.
+    ceph_abort(); // not really needed as such, but catch it.
   }
 
   dout(20) << "mapping policy=" << policy_type << dendl;
index eae5a3f4279a76e7fcef836d5a007e2e57cb0e02..3b6b9b4530e05854aa1eadb4caaf2e3c9c3fcc15 100644 (file)
@@ -87,7 +87,7 @@ struct PolicyMetaUnknown {
   }
 
   void encode(bufferlist& bl) const {
-    ceph_assert(false);
+    ceph_abort();
   }
 
   void decode(__u8 version, bufferlist::const_iterator& it) {