"unknown" is annoying because it is 0 and needs a special case.
Signed-off-by: Sage Weil <sage@redhat.com>
continue;
if ((osdid >= 0) && !(i->second.is_acting_osd(osdid,primary)))
continue;
- if (state != (uint64_t)-1 && !(i->second.state & state))
- continue;
- pgs.insert(i->first);
+ if (state == (uint64_t)-1 || // "all"
+ (i->second.state & state) || // matches a state bit
+ (state == 0 && i->second.state == 0)) { // matches "unknown" (== 0)
+ pgs.insert(i->first);
+ }
}
}
type = PG_STATE_SNAPTRIM_WAIT;
else if (state == "snaptrim_error")
type = PG_STATE_SNAPTRIM_ERROR;
+ else if (state == "unknown")
+ type = 0;
else
type = boost::none;
return type;