]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't retry readdir request after issuing caps
authorYan, Zheng <zheng.z.yan@intel.com>
Sun, 9 Dec 2012 05:03:41 +0000 (13:03 +0800)
committerSage Weil <sage@inktank.com>
Mon, 24 Dec 2012 04:01:12 +0000 (20:01 -0800)
If remote linkage without inode is encountered after some caps are
issued, Server::handle_client_readdir() should send the reply to
client immediately instead of retrying the request after opening
the remote dentry. This is because the MDS may want to revoke these
caps before the MDS succeeds in opening the remote dentry.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/Server.cc

index 6d1acc4020df49f161480be7172608e21160ae09..81c9c7c1a12015dabada21332f2c8982dc94bc2c 100644 (file)
@@ -2839,14 +2839,22 @@ void Server::handle_client_readdir(MDRequest *mdr)
        dout(10) << "skipping bad remote ino on " << *dn << dendl;
        continue;
       } else {
-       mdcache->open_remote_dentry(dn, dnp, new C_MDS_RetryRequest(mdcache, mdr));
-
        // touch everything i _do_ have
        for (it = dir->begin(); 
             it != dir->end(); 
             it++) 
          if (!it->second->get_linkage()->is_null())
            mdcache->lru.lru_touch(it->second);
+
+       // already issued caps and leases, reply immediately.
+       if (dnbl.length() > 0) {
+         mdcache->open_remote_dentry(dn, dnp, new C_NoopContext);
+         dout(10) << " open remote dentry after caps were issued, stopping at "
+                  << dnbl.length() << " < " << bytes_left << dendl;
+         break;
+       }
+
+       mdcache->open_remote_dentry(dn, dnp, new C_MDS_RetryRequest(mdcache, mdr));
        return;
       }
     }