Skip to content

Commit 5a5d43f

Browse files
committed
*, do not rely on always-false ceph_asserts to terminate execution
Signed-off-by: Radoslaw Zarzynski <[email protected]>
1 parent d00fe7a commit 5a5d43f

File tree

10 files changed

+17
-17
lines changed

10 files changed

+17
-17
lines changed

src/common/perf_histogram.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void PerfHistogramCommon::dump_formatted_axis(
3333
f->dump_string("scale_type", "log2");
3434
break;
3535
default:
36-
ceph_assert(false && "Invalid scale type");
36+
ceph_abort_msg("Invalid scale type");
3737
}
3838

3939
{
@@ -63,7 +63,7 @@ int64_t get_quants(int64_t i, PerfHistogramCommon::scale_type_d st) {
6363
case PerfHistogramCommon::SCALE_LOG2:
6464
return int64_t(1) << (i - 1);
6565
}
66-
ceph_assert(false && "Invalid scale type");
66+
ceph_abort_msg("Invalid scale type");
6767
}
6868

6969
int64_t PerfHistogramCommon::get_bucket_for_axis(
@@ -87,7 +87,7 @@ int64_t PerfHistogramCommon::get_bucket_for_axis(
8787
}
8888
return ac.m_buckets - 1;
8989
}
90-
ceph_assert(false && "Invalid scale type");
90+
ceph_abort_msg("Invalid scale type");
9191
}
9292

9393
std::vector<std::pair<int64_t, int64_t>>

src/crimson/os/alienstore/alien_store.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ auto AlienStore::omap_get_header(CollectionRef ch,
638638
return crimson::ct_error::enoent::make();
639639
} else if (r < 0) {
640640
logger().error("omap_get_header: {}", r);
641-
ceph_assert(0 == "impossible");
641+
ceph_abort_msg("impossible");
642642
} else {
643643
return get_attr_errorator::make_ready_future<ceph::bufferlist>(
644644
std::move(bl));

src/crimson/osd/scheduler/mclock_scheduler.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ item_t mClockScheduler::dequeue()
123123
} else {
124124
mclock_queue_t::PullReq result = scheduler.pull_request();
125125
if (result.is_future()) {
126-
ceph_assert(
127-
0 == "Not implemented, user would have to be able to be woken up");
126+
ceph_abort_msg(
127+
"Not implemented, user would have to be able to be woken up");
128128
return std::move(*(item_t*)nullptr);
129129
} else if (result.is_none()) {
130-
ceph_assert(
131-
0 == "Impossible, must have checked empty() first");
130+
ceph_abort_msg(
131+
"Impossible, must have checked empty() first");
132132
return std::move(*(item_t*)nullptr);
133133
} else {
134134
ceph_assert(result.is_retn());

src/librbd/crypto/CryptoContextPool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class CryptoContextPool : public DataCryptor<T> {
5757
case CIPHER_MODE_DEC:
5858
return m_decrypt_contexts;
5959
default:
60-
ceph_assert(false);
60+
ceph_abort();
6161
}
6262
}
6363
};

src/mon/Monitor.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4156,10 +4156,10 @@ struct AnonConnection : public Connection {
41564156
entity_addr_t socket_addr;
41574157

41584158
int send_message(Message *m) override {
4159-
ceph_assert(!"send_message on anonymous connection");
4159+
ceph_abort_msg("send_message on anonymous connection");
41604160
}
41614161
void send_keepalive() override {
4162-
ceph_assert(!"send_keepalive on anonymous connection");
4162+
ceph_abort_msg("send_keepalive on anonymous connection");
41634163
}
41644164
void mark_down() override {
41654165
// silently ignore

src/os/bluestore/BlueStore.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10143,7 +10143,7 @@ class ShallowFSCKThreadPool : public ThreadPool
1014310143
}
1014410144
/// Check whether there is anything to do.
1014510145
bool _empty() override {
10146-
ceph_assert(false);
10146+
ceph_abort();
1014710147
}
1014810148

1014910149
/// Get the next work item to process.
@@ -10210,7 +10210,7 @@ class ShallowFSCKThreadPool : public ThreadPool
1021010210
* so at most one copy will execute simultaneously for a given thread pool.
1021110211
* It can be used for non-thread-safe finalization. */
1021210212
void _void_process_finish(void*) override {
10213-
ceph_assert(false);
10213+
ceph_abort();
1021410214
}
1021510215

1021610216
bool queue(

src/os/bluestore/bluestore_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ struct bluestore_blob_t {
998998
}
999999
loc -= e.length;
10001000
}
1001-
ceph_assert(false);
1001+
ceph_abort();
10021002
};
10031003

10041004
/// updates blob's pextents container and return unused pextents eligible

src/osd/scheduler/OpScheduler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ OpSchedulerRef make_scheduler(
4343
mClockScheduler>(cct, whoami, num_shards, shard_id, is_rotational,
4444
op_queue_cut_off, monc);
4545
} else {
46-
ceph_assert("Invalid choice of wq" == 0);
46+
ceph_abort_msg("Invalid choice of wq");
4747
}
4848
}
4949

src/test/crimson/seastore/test_extent_allocator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct allocator_test_t :
3838
allocator.reset(new AvlAllocator(false));
3939
return seastar::now();
4040
}
41-
ceph_assert(0 == "no support");
41+
ceph_abort("no support");
4242
}
4343
seastar::future<> tear_down_fut() final {
4444
if (allocator) {

src/tools/immutable_object_cache/ObjectCacheStore.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ int ObjectCacheStore::lookup_object(std::string pool_nspace, uint64_t pool_id,
276276
return ret;
277277
default:
278278
lderr(m_cct) << "unrecognized object cache status" << dendl;
279-
ceph_assert(0);
279+
ceph_abort();
280280
}
281281
}
282282

0 commit comments

Comments
 (0)