Skip to content

Commit

Permalink
mds: only send slave rmdir prepare to auth mds of subtree
Browse files Browse the repository at this point in the history
This avoid trigger the assertion of path traverse return value
in Server::handle_slave_rmdir_prep.  (Other witness mds may release
the inode before receiving the slave rmdir prepare)

Signed-off-by: Yan, Zheng <zyan@redhat.com>
  • Loading branch information
ukernel committed Dec 8, 2016
1 parent ab49eae commit 99c9147
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/mds/Server.cc
Expand Up @@ -5535,7 +5535,14 @@ void Server::handle_client_unlink(MDRequestRef& mdr)
if (in->is_dir() && in->has_subtree_root_dirfrag()) {
// subtree root auths need to be witnesses
set<mds_rank_t> witnesses;
in->list_replicas(witnesses);

list<CDir*> dfls;
in->get_subtree_dirfrags(dfls);
for (auto p : dfls) {
if (mds->get_nodeid() != p->get_dir_auth().first)
witnesses.insert(p->get_dir_auth().first);
}

dout(10) << " witnesses " << witnesses << ", have " << mdr->more()->witnessed << dendl;

for (set<mds_rank_t>::iterator p = witnesses.begin();
Expand Down

0 comments on commit 99c9147

Please sign in to comment.