Skip to content

Commit ba90420

Browse files
authored
Merge pull request ceph#59592 from leonidc/wip-leonidc0409-blocklist-fix
leonidc0409 blocklist fix
2 parents 7f24e58 + 3106f79 commit ba90420

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/mon/NVMeofGwMap.cc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,14 @@ int NVMeofGwMap::blocklist_gw(
802802
{
803803
// find_already_created_gw(gw_id, group_key);
804804
NvmeGwMonState& gw_map = created_gws[group_key][gw_id];
805+
NvmeNonceVector nonces;
806+
for (auto& state_itr: gw_map.sm_state) {
807+
// to make blocklist on all clusters of the failing GW
808+
nonces.insert(nonces.end(), gw_map.nonce_map[state_itr.first].begin(),
809+
gw_map.nonce_map[state_itr.first].end());
810+
}
805811

806-
if (gw_map.nonce_map[grpid].size() > 0) {
812+
if (nonces.size() > 0) {
807813
NvmeNonceVector &nonce_vector = gw_map.nonce_map[grpid];;
808814
std::string str = "[";
809815
entity_addrvec_t addr_vect;
@@ -817,10 +823,10 @@ int NVMeofGwMap::blocklist_gw(
817823
str += it;
818824
}
819825
str += "]";
820-
bool rc = addr_vect.parse(&str[0]);
821-
dout(10) << str << " rc " << rc << " network vector: " << addr_vect
826+
bool success = addr_vect.parse(&str[0]);
827+
dout(10) << str << " parse success " << success << " network vector: " << addr_vect
822828
<< " " << addr_vect.size() << dendl;
823-
if (rc) {
829+
if (!success) {
824830
return 1;
825831
}
826832

0 commit comments

Comments
 (0)