]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/Session: use projected parent for auth path check 6200/head
authorSage Weil <sage@redhat.com>
Thu, 8 Oct 2015 02:59:43 +0000 (22:59 -0400)
committerSage Weil <sage@redhat.com>
Thu, 8 Oct 2015 02:59:43 +0000 (22:59 -0400)
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 <sage@redhat.com>
src/mds/SessionMap.cc

index 3593867de76039a28ef38dfd8bf32e343b610b69..4d56a5af43a90d6e294acde4595753137863e1ef 100644 (file)
@@ -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;