From: Yan, Zheng Date: Fri, 11 Jan 2013 07:46:59 +0000 (+0800) Subject: mds: fix end check in Server::handle_client_readdir() X-Git-Tag: v0.57~88^2~29 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6bd676ea7914174c9af86894c82ca49117478f2c;p=ceph.git 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 --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index b70445e9a1db..45eed81c6ac8 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2895,11 +2895,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) {