Skip to content

Commit

Permalink
Merge pull request ceph#10565 from dzafman/wip-16672
Browse files Browse the repository at this point in the history
OSD crash with Hammer to Jewel Upgrade: void FileStore::init_temp_collections()

Reviewed-by: Samuel Just <[email protected]>
  • Loading branch information
dzafman authored Aug 5, 2016
2 parents b0dbd1f + ba88a3a commit 6fed82a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/os/filestore/FileStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4575,6 +4575,7 @@ int FileStore::_collection_remove_recursive(const coll_t &cid,
if (r < 0)
return r;
}
objects.clear();
}
return _destroy_collection(cid);
}
Expand Down Expand Up @@ -4771,7 +4772,7 @@ int FileStore::collection_list(const coll_t& c, ghobject_t start, ghobject_t end
assert(!m_filestore_fail_eio || r != -EIO);
return r;
}
dout(20) << "objects: " << ls << dendl;
dout(20) << "objects: " << *ls << dendl;

// HashIndex doesn't know the pool when constructing a 'next' value
if (next && !next->is_max()) {
Expand Down
12 changes: 10 additions & 2 deletions src/os/filestore/HashIndex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,12 @@ int HashIndex::recursive_create_path(vector<string>& path, int level)
}

int HashIndex::recursive_remove(const vector<string> &path) {
return _recursive_remove(path, true);
}

int HashIndex::_recursive_remove(const vector<string> &path, bool top) {
vector<string> subdirs;
dout(20) << __func__ << " path=" << path << dendl;
int r = list_subdirs(path, &subdirs);
if (r < 0)
return r;
Expand All @@ -565,12 +570,15 @@ int HashIndex::recursive_remove(const vector<string> &path) {
i != subdirs.end();
++i) {
subdir.push_back(*i);
r = recursive_remove(subdir);
r = _recursive_remove(subdir, false);
if (r < 0)
return r;
subdir.pop_back();
}
return remove_path(path);
if (top)
return 0;
else
return remove_path(path);
}

int HashIndex::start_col_split(const vector<string> &path) {
Expand Down
5 changes: 5 additions & 0 deletions src/os/filestore/HashIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ class HashIndex : public LFNIndex {
ghobject_t *next
);
private:
/// Internal recursively remove path and its subdirs
int _recursive_remove(
const vector<string> &path, ///< [in] path to remove
bool top ///< [in] internal tracking of first caller
); /// @return Error Code, 0 on success
/// Recursively remove path and its subdirs
int recursive_remove(
const vector<string> &path ///< [in] path to remove
Expand Down

0 comments on commit 6fed82a

Please sign in to comment.