From 1e57e6de273b89e6166ec4bac1b42a9d4e1ceeea Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 7 Oct 2015 22:59:43 -0400 Subject: [PATCH] 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 --- src/mds/SessionMap.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mds/SessionMap.cc b/src/mds/SessionMap.cc index 3593867de7603..4d56a5af43a90 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; -- 2.39.5