ECBackend::handle_recovery_read_complete: do not expose the hash_info when getting the obc

Aside from expose an ECBackend internal detail, it causes ReplicatedPG
to cache the value causing trouble with WRITEFULL.

Partially fixes: #12983
Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
Samuel Just 2015-09-25 13:52:53 -07:00 committed by David Zafman
parent 892800b4dc
commit d7b620f9dc

View File

@ -383,7 +383,12 @@ void ECBackend::handle_recovery_read_complete(
++it) {
it->second.rebuild();
}
op.obc = get_parent()->get_obc(hoid, op.xattrs);
// Need to remove ECUtil::get_hinfo_key() since it should not leak out
// of the backend (see bug #12983)
map<string, bufferlist> sanitized_attrs(op.xattrs);
sanitized_attrs.erase(ECUtil::get_hinfo_key());
op.obc = get_parent()->get_obc(hoid, sanitized_attrs);
assert(op.obc);
op.recovery_info.size = op.obc->obs.oi.size;
op.recovery_info.oi = op.obc->obs.oi;
}