@@ -376,13 +376,15 @@ void ECBackendL::RecoveryBackend::handle_recovery_read_complete(
376376 for (set<shard_id_t >::iterator i = op.missing_on_shards .begin ();
377377 i != op.missing_on_shards .end ();
378378 ++i) {
379- target[*i] = &(op.returned_data [*i]);
379+ int s = static_cast <int >(*i);
380+ target[s] = &(op.returned_data [s]);
380381 }
381382 map<int , bufferlist> from;
382383 for (map<pg_shard_t , bufferlist>::iterator i = to_read.get <2 >().begin ();
383384 i != to_read.get <2 >().end ();
384385 ++i) {
385- from[i->first .shard ] = std::move (i->second );
386+ int s = static_cast <int >(i->first .shard );
387+ from[s] = std::move (i->second );
386388 }
387389 dout (10 ) << __func__ << " : " << from << dendl;
388390 int r;
@@ -637,12 +639,12 @@ void ECBackendL::RecoveryBackend::continue_recovery_op(
637639 for (set<pg_shard_t >::iterator mi = op.missing_on .begin ();
638640 mi != op.missing_on .end ();
639641 ++mi) {
640- ceph_assert (op.returned_data .count (mi->shard ));
642+ ceph_assert (op.returned_data .count (static_cast < int >( mi->shard ) ));
641643 m->pushes [*mi].push_back (PushOp ());
642644 PushOp &pop = m->pushes [*mi].back ();
643645 pop.soid = op.hoid ;
644646 pop.version = op.v ;
645- pop.data = op.returned_data [mi->shard ];
647+ pop.data = op.returned_data [static_cast < int >( mi->shard ) ];
646648 dout (10 ) << __func__ << " : before_progress=" << op.recovery_progress
647649 << " , after_progress=" << after_progress
648650 << " , pop.data.length()=" << pop.data .length ()
@@ -1126,11 +1128,12 @@ void ECBackendL::handle_sub_read(
11261128 dout (20 ) << __func__ << " : Checking hash of " << i->first << dendl;
11271129 bufferhash h (-1 );
11281130 h << bl;
1129- if (h.digest () != hinfo->get_chunk_hash (shard)) {
1131+ int s = static_cast <int >(shard);
1132+ if (h.digest () != hinfo->get_chunk_hash (s)) {
11301133 get_parent ()->clog_error () << " Bad hash for " << i->first << " digest 0x"
1131- << hex << h.digest () << " expected 0x" << hinfo->get_chunk_hash (shard ) << dec;
1134+ << hex << h.digest () << " expected 0x" << hinfo->get_chunk_hash (s ) << dec;
11321135 dout (5 ) << __func__ << " : Bad hash for " << i->first << " digest 0x"
1133- << hex << h.digest () << " expected 0x" << hinfo->get_chunk_hash (shard ) << dec << dendl;
1136+ << hex << h.digest () << " expected 0x" << hinfo->get_chunk_hash (s ) << dec << dendl;
11341137 r = -EIO;
11351138 goto error;
11361139 }
@@ -1307,7 +1310,7 @@ void ECBackendL::handle_sub_read_reply(
13071310 iter->second .returned .front ().get <2 >().begin ();
13081311 j != iter->second .returned .front ().get <2 >().end ();
13091312 ++j) {
1310- have.insert (j->first .shard );
1313+ have.insert (static_cast < int >( j->first .shard ) );
13111314 dout (20 ) << __func__ << " have shard=" << j->first .shard << dendl;
13121315 }
13131316 map<int , vector<pair<int , int >>> dummy_minimum;
@@ -1802,11 +1805,11 @@ int ECBackendL::be_deep_scrub(
18021805 return 0 ;
18031806 }
18041807
1805- if (hinfo-> get_chunk_hash (get_parent ()->whoami_shard ().shard ) !=
1806- pos.data_hash .digest ()) {
1808+ int s = static_cast < int > (get_parent ()->whoami_shard ().shard );
1809+ if (hinfo-> get_chunk_hash (s) != pos.data_hash .digest ()) {
18071810 dout (0 ) << " _scan_list " << poid << " got incorrect hash on read 0x"
18081811 << std::hex << pos.data_hash .digest () << " != expected 0x"
1809- << hinfo->get_chunk_hash (get_parent ()-> whoami_shard (). shard )
1812+ << hinfo->get_chunk_hash (s )
18101813 << std::dec << dendl;
18111814 o.ec_hash_mismatch = true ;
18121815 return 0 ;
0 commit comments