Merge PR #17689 into master

* refs/remotes/upstream/pull/17689/head:
	ceph: fix "stopping mds can't export subtree"

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
Patrick Donnelly 2017-09-13 18:29:20 -07:00
commit f818905e0f
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB
2 changed files with 6 additions and 5 deletions

View File

@ -6498,7 +6498,8 @@ bool MDCache::trim(int max, int count)
if (!diri->is_auth() && !diri->is_base() &&
dir->get_num_head_items() == 0) {
if (dir->state_test(CDir::STATE_EXPORTING) ||
dir->is_freezing() || dir->is_frozen() || !mds->is_active())
!(mds->is_active() || mds->is_stopping()) ||
dir->is_freezing() || dir->is_frozen())
continue;
migrator->export_empty_import(dir);

View File

@ -776,6 +776,10 @@ void Migrator::export_dir(CDir *dir, mds_rank_t dest)
assert(dir->is_auth());
assert(dest != mds->get_nodeid());
if (!(mds->is_active() || mds->is_stopping())) {
dout(7) << "i'm not active, no exports for now" << dendl;
return;
}
if (mds->mdcache->is_readonly()) {
dout(7) << "read-only FS, no exports for now" << dendl;
return;
@ -793,10 +797,6 @@ void Migrator::export_dir(CDir *dir, mds_rank_t dest)
//ceph_abort();
return;
}
if (!mds->is_active()) {
dout(7) << "i'm not active, no exports for now" << dendl;
return;
}
if (!dir->inode->is_base() && dir->inode->get_projected_parent_dir()->inode->is_stray() &&
dir->inode->get_projected_parent_dir()->get_parent_dir()->ino() != MDS_INO_MDSDIR(dest)) {