From patchwork Mon Jan 28 02:28:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 2052971 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 58130DFE86 for ; Mon, 28 Jan 2013 02:28:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752200Ab3A1C2f (ORCPT ); Sun, 27 Jan 2013 21:28:35 -0500 Received: from mga01.intel.com ([192.55.52.88]:52188 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751977Ab3A1C2e (ORCPT ); Sun, 27 Jan 2013 21:28:34 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 27 Jan 2013 18:28:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,548,1355126400"; d="scan'208";a="279067351" Received: from zyan5-mobl.sh.intel.com ([10.239.36.156]) by fmsmga001.fm.intel.com with ESMTP; 27 Jan 2013 18:28:32 -0800 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org, sage@inktank.com Cc: "Yan, Zheng" Subject: [PATCH 5/6] mds: mark export bounds for cross authority directory rename Date: Mon, 28 Jan 2013 10:28:25 +0800 Message-Id: <1359340106-24257-6-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1359340106-24257-1-git-send-email-zheng.z.yan@intel.com> References: <1359340106-24257-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" this guarantees that the importing MDS gets directory fragment's up-to-date fragstat/rstat. Signed-off-by: Yan, Zheng --- src/mds/Server.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 520d389..6dc3b9c 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -6322,11 +6322,22 @@ void Server::_logged_slave_rename(MDRequest *mdr, // export srci? if (srcdn->is_auth() && srcdnl->is_primary()) { - list finished; + // set export bounds for CInode::encode_export() + list bounds; + if (srcdnl->get_inode()->is_dir()) { + srcdnl->get_inode()->get_dirfrags(bounds); + for (list::iterator p = bounds.begin(); p != bounds.end(); p++) + (*p)->state_set(CDir::STATE_EXPORTBOUND); + } + map exported_client_map; bufferlist inodebl; mdcache->migrator->encode_export_inode(srcdnl->get_inode(), inodebl, exported_client_map); + + for (list::iterator p = bounds.begin(); p != bounds.end(); ++p) + (*p)->state_clear(CDir::STATE_EXPORTBOUND); + ::encode(exported_client_map, reply->inode_export); reply->inode_export.claim_append(inodebl); reply->inode_export_v = srcdnl->get_inode()->inode.version;