]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-objectstore-tool: better error message if pgid and object do not match 30501/head
authorSage Weil <sage@redhat.com>
Fri, 20 Sep 2019 19:16:30 +0000 (14:16 -0500)
committerSage Weil <sage@redhat.com>
Fri, 20 Sep 2019 19:16:33 +0000 (14:16 -0500)
Fixes: https://tracker.ceph.com/issues/41913
Signed-off-by: Sage Weil <sage@redhat.com>
src/tools/ceph_objectstore_tool.cc

index 1830f7e16816bd374600eea1977be00b81f72411..5e2057f54da0a000f3938c9512ce41a5700d5644 100644 (file)
@@ -3758,6 +3758,12 @@ int main(int argc, char **argv)
           ret = 1;
           goto out;
         }
+       auto ch = fs->open_collection(coll_t(pgid));
+       if (!ghobj.match(fs->collection_bits(ch), pgid.ps())) {
+         stringstream ss;
+         ss << "object " << ghobj << " not contained by pg " << pgid;
+         throw std::runtime_error(ss.str());
+       }
       }
     } catch (std::runtime_error& e) {
       cerr << e.what() << std::endl;