From patchwork Mon Jan 14 12:28:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 1971971 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 046A7DF23A for ; Mon, 14 Jan 2013 12:28:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756284Ab3ANM2U (ORCPT ); Mon, 14 Jan 2013 07:28:20 -0500 Received: from mga14.intel.com ([143.182.124.37]:37986 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755533Ab3ANM2T (ORCPT ); Mon, 14 Jan 2013 07:28:19 -0500 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 14 Jan 2013 04:28:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,468,1355126400"; d="scan'208";a="190856752" Received: from unknown (HELO zyan5-mobl.amr.corp.intel.com) ([10.255.14.209]) by AZSMGA002.ch.intel.com with ESMTP; 14 Jan 2013 04:28:15 -0800 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org, sage@inktank.com Cc: "Yan, Zheng" Subject: [PATCH 1/2] mds: fix end check in Server::handle_client_readdir() Date: Mon, 14 Jan 2013 20:28:13 +0800 Message-Id: <1358166493-21891-1-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org From: "Yan, Zheng" 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 --- src/mds/Server.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index eb0682e..328d025 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) {