From aebc1caee86b70f51d7d2d16f25f0ee9e4119f43 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 21 Apr 2017 10:31:10 -0400 Subject: [PATCH] mds: use projected parent to avoid unsafe access Add-on to: 26a08f31f7965afb062b027a4455620b52e7a67e Credit to Zheng for noticing. Signed-off-by: Patrick Donnelly --- src/mds/Migrator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 9e43b8624e7..31aabc9c575 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -793,8 +793,8 @@ void Migrator::export_dir(CDir *dir, mds_rank_t dest) return; } - 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)) { + if (!dir->inode->is_base() && dir->inode->get_projected_parent_dir()->inode->is_stray() && + dir->inode->get_projected_parent_dir()->get_parent_dir()->inode->is_mdsdir()) { dout(7) << "i won't export anything in stray" << dendl; return; } -- 2.39.5