Skip to content

Commit f19a8ab

Browse files
Merge pull request ceph#64987 from aainscow/ceph-objectstore-tool-pgid-fix
tools: ceph-objectstore-tool check for invalid pgid
2 parents 4413740 + 771a100 commit f19a8ab

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/tools/ceph_objectstore_tool.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4172,6 +4172,11 @@ int main(int argc, char **argv)
41724172
}
41734173
if (pgidstr != "meta") {
41744174
auto ch = fs->open_collection(coll_t(pgid));
4175+
if (!ch) {
4176+
stringstream ss;
4177+
cerr << "PG '" << pgid << "' not found" << std::endl;
4178+
throw std::runtime_error(ss.str());
4179+
}
41754180
if (!ghobj.match(fs->collection_bits(ch), pgid.ps())) {
41764181
stringstream ss;
41774182
ss << "object " << ghobj << " not contained by pg " << pgid;

0 commit comments

Comments
 (0)