]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: check projected parent to avoid unsafe access
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 18 Apr 2017 02:33:19 +0000 (22:33 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 18 Apr 2017 02:57:46 +0000 (22:57 -0400)
An anonymous inode may not have a stable parent so immediate migration would
cause a segfault when checking for strays.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/Migrator.cc

index f375c086ff09bbf4ecae2f893c2b75f7d5ab1140..4a508256fccf734593c0467d04a77d7a1ed06eb3 100644 (file)
@@ -781,7 +781,7 @@ void Migrator::export_dir(CDir *dir, mds_rank_t dest)
     return;
   }
 
-  if (!dir->inode->is_base() && dir->get_parent_dir()->get_inode()->is_stray() &&
+  if (!dir->inode->is_base() && dir->get_inode()->get_projected_parent_dir()->get_inode()->is_stray() &&
       dir->get_parent_dir()->get_parent_dir()->ino() != MDS_INO_MDSDIR(dest)) {
     dout(7) << "i won't export anything in stray" << dendl;
     return;