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>
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;
}