]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/SessionMap: fix check_access for stray inodes
authorSage Weil <sage@redhat.com>
Wed, 2 Sep 2015 02:30:36 +0000 (22:30 -0400)
committerSage Weil <sage@redhat.com>
Thu, 1 Oct 2015 13:42:36 +0000 (09:42 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mds/SessionMap.cc

index e36945c31b728a618e0359294fcda06be776b7b0..9cd37a32dd1be88986a20509e7e29c96747ca7e3 100644 (file)
@@ -732,6 +732,9 @@ void SessionMap::save_if_dirty(const std::set<entity_name_t> &tgt_sessions,
 // =================
 // Session
 
+#undef dout_prefix
+#define dout_prefix *_dout << "Session "
+
 /**
  * Calculate the length of the `requests` member list,
  * because elist does not have a size() method.
@@ -832,14 +835,18 @@ void Session::decode(bufferlist::iterator &p)
   _update_human_name();
 }
 
-bool Session::check_access(CInode *in, unsigned mask, int caller_uid, int caller_gid, int setattr_uid, int setattr_gid)
+bool Session::check_access(CInode *in, unsigned mask,
+                          int caller_uid, int caller_gid,
+                          int setattr_uid, int setattr_gid)
 {
   string path;
-
-  if (in->is_stray()){
+  CInode *diri = in->get_parent_inode();
+  if (diri && diri->is_stray()){
     path = in->get_projected_inode()->stray_prior_path;
+    dout(20) << __func__ << " stray_prior_path " << path << dendl;
   } else {
     in->make_path_string(path, false, in->get_projected_parent_dn());
+    dout(20) << __func__ << " path " << path << dendl;
   }
   if (path.length())
     path = path.substr(1);    // drop leading /