summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2013-01-23 11:08:37 +0800
committerSage Weil <sage@inktank.com>2013-01-23 09:14:59 -0800
commita972fd4086dea05b2e7943a20bc8c8d58afbf93c (patch)
tree3ec7b2ccb298a7ba0fba6ce9fa44340c99905055
parent17160843d0c523359d8fa934418ff2c1f7bffb25 (diff)
downloadceph-a972fd4086dea05b2e7943a20bc8c8d58afbf93c.tar.gz
mds: fix end check in Server::handle_client_readdir()
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>
-rw-r--r--src/mds/Server.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index dc14bbe2b8d..87813595fd1 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -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) {