From: Sage Weil Date: Thu, 8 Oct 2015 02:59:43 +0000 (-0400) Subject: mds/Session: use projected parent for auth path check X-Git-Tag: v10.0.0~113^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F6200%2Fhead;p=ceph.git mds/Session: use projected parent for auth path check In particular, a file's current path might indicate no parent because the initial link into the tree isn't committed yet. Fixes: #13364 Signed-off-by: Sage Weil --- diff --git a/src/mds/SessionMap.cc b/src/mds/SessionMap.cc index 3593867de760..4d56a5af43a9 100644 --- a/src/mds/SessionMap.cc +++ b/src/mds/SessionMap.cc @@ -840,7 +840,9 @@ bool Session::check_access(CInode *in, unsigned mask, int new_uid, int new_gid) { string path; - CInode *diri = in->get_parent_inode(); + CInode *diri = NULL; + if (!in->is_base()) + diri = in->get_projected_parent_dn()->get_dir()->get_inode(); if (diri && diri->is_stray()){ path = in->get_projected_inode()->stray_prior_path; dout(20) << __func__ << " stray_prior_path " << path << dendl;