]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix choose_target_mds for requests that do name lookup 23700/head
authorYan, Zheng <zyan@redhat.com>
Mon, 6 Aug 2018 06:51:09 +0000 (14:51 +0800)
committerJos Collin <jcollin@redhat.com>
Thu, 23 Aug 2018 06:23:27 +0000 (11:53 +0530)
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 436d1741e623748bc0dfd4e305d4c07cc602a093)

src/client/Client.cc

index 13258bce90e9bd5f4827fec35c8f4e5069d8243c..e8c2fcf7156e166c69fbf391ab08bdd1051c2e13 100644 (file)
@@ -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;
       }