]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: allow export of pinned directory if empty
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 8 Jun 2020 23:50:44 +0000 (16:50 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 2 Jul 2020 00:19:53 +0000 (17:19 -0700)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 4749e5abb16a38b34ed63d11dbcd8bf3831b3f13)

src/mds/Migrator.cc

index 874e56416aa68a85fb81082fcbe2808b3fbc5a93..355cc3c0dfa5440a3488e096d71929a59f07a1e2 100644 (file)
@@ -790,7 +790,7 @@ void Migrator::export_dir(CDir *dir, mds_rank_t dest)
   ceph_assert(dest != mds->get_nodeid());
    
   CDir* parent = dir->inode->get_projected_parent_dir();
-  if (!mds->is_stopping() && !dir->inode->is_exportable(dest)) {
+  if (!mds->is_stopping() && !dir->inode->is_exportable(dest) && dir->get_num_head_items() > 0) {
     dout(7) << "Cannot export to mds." << dest << " " << *dir << ": dir is export pinned" << dendl;
     return;
   } else if (!(mds->is_active() || mds->is_stopping())) {