From fce951300cd4870455afa00495bb510c6faa6f8a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 12 May 2008 15:14:35 -0700 Subject: [PATCH] mds: don't export or split unlinked dirs in stray --- src/mds/MDCache.cc | 5 +++++ src/mds/Migrator.cc | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index be22af1f67170..527c63cacb95f 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6069,6 +6069,11 @@ void MDCache::split_dir(CDir *dir, int bits) //assert(0); return; } + if (dir->inode->get_parent_dir() && + dir->inode->get_parent_dir()->get_inode()->is_stray()) { + dout(7) << "i won't split anything in stray" << dendl; + return; + } if (dir->state_test(CDir::STATE_FRAGMENTING)) { dout(7) << "already fragmenting" << dendl; return; diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 93779b7d7ee9a..e9965486c42e0 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -556,12 +556,16 @@ void Migrator::export_dir(CDir *dir, int dest) dout(7) << "cluster degraded, no exports for now" << dendl; return; } - - if (dir->inode->is_root()) { - dout(7) << "i won't export root" << dendl; + if (dir->inode->is_base()) { + dout(7) << "i won't export root|stray" << dendl; //assert(0); return; } + if (dir->inode->get_parent_dir()->get_inode()->is_stray()) { + dout(7) << "i won't export anything in stray" << dendl; + return; + } + if (dir->is_frozen() || dir->is_freezing()) { -- 2.39.5