From 4d532cb6d9ae8f44416f42d68ce0d2290ce5451c Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Thu, 14 Mar 2013 11:23:48 +0800 Subject: [PATCH] mds: check MDS peer's state through mdsmap 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 cf95d6ebb2948..e1cb08f1da0a8 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; -- 2.39.5