Skip to content

Commit

Permalink
client: fix choose_target_mds for requests that do name lookup
Browse files Browse the repository at this point in the history
There are two cases that a dirfrag is not recorded in CInode::fragmap.
One is that the dirfrag is not subtree root, another is that client does
not know which mds is dirfrag's auth mds. For the both cases, requests
that do name lookup are better to sent to dir inode's auth mds.

Fixes: http://tracker.ceph.com/issues/26860
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit 436d174)
  • Loading branch information
ukernel authored and joscollin committed Aug 23, 2018
1 parent d883e76 commit 6c8f648
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/client/Client.cc
Expand Up @@ -1461,6 +1461,10 @@ mds_rank_t Client::choose_target_mds(MetaRequest *req, Inode** phash_diri)
mds = in->fragmap[fg];
if (phash_diri)
*phash_diri = in;
} else if (in->auth_cap) {
mds = in->auth_cap->session->mds_num;
}
if (mds >= 0) {
ldout(cct, 10) << __func__ << " from dirfragtree hash" << dendl;
goto out;
}
Expand Down

0 comments on commit 6c8f648

Please sign in to comment.