]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix end check in Server::handle_client_readdir()
authorYan, Zheng <zheng.z.yan@intel.com>
Wed, 23 Jan 2013 03:08:37 +0000 (11:08 +0800)
committerSage Weil <sage@inktank.com>
Wed, 23 Jan 2013 17:14:59 +0000 (09:14 -0800)
commit 1174dd3188 (don't retry readdir request after issuing caps)
introduced an bug that wrongly marks 'end' in the the readdir reply.
The code that touches existing dentries re-uses an iterator, and the
iterator is used for checking if readdir is end.

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

index dc14bbe2b8d77d7b75cdde573625fd0674c1b918..87813595fd1351433251c248e1cac4112f7b8e1d 100644 (file)
@@ -2873,11 +2873,9 @@ void Server::handle_client_readdir(MDRequest *mdr)
        continue;
       } else {
        // 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);
+       for (CDir::map_t::iterator p = dir->begin(); p != dir->end(); p++)
+         if (!p->second->get_linkage()->is_null())
+           mdcache->lru.lru_touch(p->second);
 
        // already issued caps and leases, reply immediately.
        if (dnbl.length() > 0) {