]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/SnapMapper: to_raw_key: use hobject pool member, not SnapMapper:pool
authorSage Weil <sage@redhat.com>
Thu, 11 Jul 2019 22:21:23 +0000 (17:21 -0500)
committerSage Weil <sage@redhat.com>
Fri, 12 Jul 2019 14:55:06 +0000 (09:55 -0500)
Some callers (ceph-objectstore-tool) instantiate SnapMapper with a bogus
pool id (0) and want to use it to adjust mappings.  We have the hobj
available, so use its pool member instead.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/SnapMapper.cc

index b6eb7ec4b0aec464703fc09188396f7cfaf6193a..d61b43decc610844163b2412df4d55caa1bed886 100644 (file)
@@ -102,7 +102,7 @@ string SnapMapper::get_prefix(int64_t pool, snapid_t snap)
 string SnapMapper::to_raw_key(
   const pair<snapid_t, hobject_t> &in)
 {
-  return get_prefix(pool, in.first) + shard_prefix + in.second.to_str();
+  return get_prefix(in.second.pool, in.first) + shard_prefix + in.second.to_str();
 }
 
 pair<string, bufferlist> SnapMapper::to_raw(