]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: correct unsigned/signed compiler wrn
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 2 Oct 2023 16:42:28 +0000 (16:42 +0000)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 2 Oct 2023 22:03:25 +0000 (22:03 +0000)
    /home/pdonnell/ceph/src/osd/OSD.cc: In member function ‘void OSD::ShardedOpWQ::stop_for_fast_shutdown()’:
    /home/pdonnell/ceph/src/osd/OSD.cc:11143:41: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
    11143 |   for (int shard_index = 0; shard_index < osd->num_shards; shard_index++) {

Fixes: https://tracker.ceph.com/issues/62851
Fixes: 210dbd4ff19ea66fd2f0109cc15aad53349be52f
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/osd/OSD.cc

index d6948cf05a76f0b8cb23bc2a3c09bac72c7c57a1..f01540c3a930718acc815699f812e03da1458df8 100644 (file)
@@ -11140,7 +11140,7 @@ void OSD::ShardedOpWQ::stop_for_fast_shutdown()
 {
   m_fast_shutdown = true;
 
-  for (int shard_index = 0; shard_index < osd->num_shards; shard_index++) {
+  for (uint64_t shard_index = 0; shard_index < osd->num_shards; shard_index++) {
     auto& sdata = osd->shards[shard_index];
     ceph_assert(sdata);
     std::lock_guard l(sdata->shard_lock);