<< ", skipping" << dendl;
} else if (r == -EIO) {
dout(25) << __func__ << " " << poid << " got " << r
- << ", read_error" << dendl;
+ << ", stat_error" << dendl;
ScrubMap::object &o = map.objects[poid];
- o.read_error = true;
+ o.stat_error = true;
} else {
derr << __func__ << " got: " << cpp_strerror(r) << dendl;
assert(0);
ostream &errorstream)
{
enum scrub_error_type error = CLEAN;
+ if (candidate.stat_error) {
+ error = SHALLOW_ERROR;
+ errorstream << "candidate had a stat error";
+ }
if (candidate.read_error) {
- // This can occur on stat() of a shallow scrub, but in that case size will
- // be invalid, and this will be over-ridden below.
error = DEEP_ERROR;
errorstream << "candidate had a read error";
}
<< " from auth shard " << auth_shard;
}
}
- // Shallow error takes precendence because this will be seen by
- // both types of scrubs.
- if (auth.size != candidate.size) {
+ if (!candidate.stat_error && auth.size != candidate.size) {
if (error != CLEAN)
errorstream << ", ";
if (error != DEEP_ERROR)
if (i == j->second->objects.end()) {
continue;
}
- if (i->second.read_error) {
- // scrub encountered read error, probably corrupt
+ if (i->second.read_error || i->second.stat_error) {
+ // scrub encountered read error or stat_error, probably corrupt
dout(10) << __func__ << ": rejecting osd " << j->first
<< " for obj " << obj
- << ", read_error"
+ << "," << (i->second.read_error ? " read_error" : "")
+ << (i->second.stat_error ? " stat_error" : "")
<< dendl;
continue;
}
void ScrubMap::object::encode(bufferlist& bl) const
{
- ENCODE_START(6, 2, bl);
+ ENCODE_START(7, 2, bl);
::encode(size, bl);
::encode(negative, bl);
::encode(attrs, bl);
::encode(omap_digest, bl);
::encode(omap_digest_present, bl);
::encode(read_error, bl);
+ ::encode(stat_error, bl);
ENCODE_FINISH(bl);
}
void ScrubMap::object::decode(bufferlist::iterator& bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(6, 2, 2, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(7, 2, 2, bl);
::decode(size, bl);
bool tmp;
::decode(tmp, bl);
::decode(tmp, bl);
read_error = tmp;
}
+ if (struct_v >= 7) {
+ ::decode(tmp, bl);
+ stat_error = tmp;
+ }
DECODE_FINISH(bl);
}
bool digest_present:1;
bool omap_digest_present:1;
bool read_error:1;
+ bool stat_error:1;
object() :
// Init invalid size so it won't match if we get a stat EIO error
size(-1), omap_digest(0), digest(0), nlinks(0),
negative(false), digest_present(false), omap_digest_present(false),
- read_error(false) {}
+ read_error(false), stat_error(false) {}
void encode(bufferlist& bl) const;
void decode(bufferlist::iterator& bl);