]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
crimson/os/seastore: open_collection() returns nullptr if DNE 41708/head
authorKefu Chai <kchai@redhat.com>
Sat, 5 Jun 2021 09:39:25 +0000 (17:39 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 5 Jun 2021 10:02:45 +0000 (18:02 +0800)
commit9fbd60131b5396beb81ce745c9ccf01388f7e303
treeec54e48b08b31f94b2d073b48e046d85ae91494d
parentca48d1cbdb657f6fd661b5fabbba8dbe9eb9e427
crimson/os/seastore: open_collection() returns nullptr if DNE

we check for the existence of meta collection by trying to open it,
if it exists, we continue check for the superblock stored in it, if
the superblock does not exist or corrupted, we consider it as a failure.

before this change, open_collection() always return a valud Collection
even if the store does not have the collection with specified cid. this
behavior could be misleading in the use case above.

after this change, open_collection() looks up the collections stored in
root collection node for the specfied cid, and return nullptr if it does
not exist.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/os/seastore/seastore.cc