if (hoid.snap < CEPH_MAXSNAP) {
// fake nlinks for old primaries
bufferlist bl;
+ if (o.attrs.find(OI_ATTR) == o.attrs.end()) {
+ o.nlinks = 0;
+ continue;
+ }
bl.push_back(o.attrs[OI_ATTR]);
- object_info_t oi(bl);
+ object_info_t oi;
+ try {
+ oi = bl;
+ } catch(...) {
+ o.nlinks = 0;
+ continue;
+ }
if (oi.snaps.empty()) {
// Just head
o.nlinks = 1;
object_info_t(bufferlist& bl) {
decode(bl);
}
+ object_info_t operator=(bufferlist& bl) {
+ decode(bl);
+ return *this;
+ }
};
WRITE_CLASS_ENCODER(object_info_t)