From patchwork Sun Mar 17 14:51:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 2283911 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 4D9B9E00E5 for ; Sun, 17 Mar 2013 15:06:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932713Ab3CQOxp (ORCPT ); Sun, 17 Mar 2013 10:53:45 -0400 Received: from mga03.intel.com ([143.182.124.21]:30053 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932712Ab3CQOxo (ORCPT ); Sun, 17 Mar 2013 10:53:44 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 17 Mar 2013 07:53:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,859,1355126400"; d="scan'208";a="215704494" Received: from unknown (HELO zyan5-mobl.ccr.corp.intel.com) ([10.255.20.118]) by AZSMGA002.ch.intel.com with ESMTP; 17 Mar 2013 07:53:40 -0700 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org Cc: sage@inktank.com, greg@inktank.com, "Yan, Zheng" Subject: [PATCH 30/39] mds: check MDS peer's state through mdsmap Date: Sun, 17 Mar 2013 22:51:33 +0800 Message-Id: <1363531902-24909-31-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1363531902-24909-1-git-send-email-zheng.z.yan@intel.com> References: <1363531902-24909-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" Signed-off-by: Yan, Zheng Reviewed-by: Greg Farnum --- src/mds/Migrator.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index d626cb1..143d71e 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -238,7 +238,7 @@ void Migrator::handle_mds_failure_or_stop(int who) export_unlock(dir); export_locks.erase(dir); dir->state_clear(CDir::STATE_EXPORTING); - if (export_peer[dir] != who) // tell them. + if (mds->mdsmap->is_clientreplay_or_active_or_stopping(export_peer[dir])) // tell them. mds->send_message_mds(new MExportDirCancel(dir->dirfrag()), export_peer[dir]); break; @@ -247,7 +247,7 @@ void Migrator::handle_mds_failure_or_stop(int who) dir->unfreeze_tree(); // cancel the freeze export_state.erase(dir); // clean up dir->state_clear(CDir::STATE_EXPORTING); - if (export_peer[dir] != who) // tell them. + if (mds->mdsmap->is_clientreplay_or_active_or_stopping(export_peer[dir])) // tell them. mds->send_message_mds(new MExportDirCancel(dir->dirfrag()), export_peer[dir]); break; @@ -278,7 +278,7 @@ void Migrator::handle_mds_failure_or_stop(int who) export_unlock(dir); export_locks.erase(dir); dir->state_clear(CDir::STATE_EXPORTING); - if (export_peer[dir] != who) // tell them. + if (mds->mdsmap->is_clientreplay_or_active_or_stopping(export_peer[dir])) // tell them. mds->send_message_mds(new MExportDirCancel(dir->dirfrag()), export_peer[dir]); break;