From patchwork Tue Dec 11 08:30:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 1861201 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 94EC73FCA5 for ; Tue, 11 Dec 2012 08:31:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752559Ab2LKIbQ (ORCPT ); Tue, 11 Dec 2012 03:31:16 -0500 Received: from mga11.intel.com ([192.55.52.93]:16602 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752519Ab2LKIbO (ORCPT ); Tue, 11 Dec 2012 03:31:14 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 11 Dec 2012 00:31:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,256,1355126400"; d="scan'208";a="262275500" Received: from zyan5-mobl.sh.intel.com ([10.239.36.25]) by fmsmga002.fm.intel.com with ESMTP; 11 Dec 2012 00:31:12 -0800 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org, sage@inktank.com Cc: "Yan, Zheng" Subject: [PATCH 10/14] mds: don't retry readdir request after issuing caps Date: Tue, 11 Dec 2012 16:30:56 +0800 Message-Id: <1355214660-26354-11-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1355214660-26354-1-git-send-email-zheng.z.yan@intel.com> References: <1355214660-26354-1-git-send-email-zheng.z.yan@intel.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org From: "Yan, Zheng" 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 --- src/mds/Server.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index c8c52e1..c95344e 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -2830,14 +2830,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; } }