]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: behave if we can't getattr parents of mount point
authorSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 20:48:17 +0000 (16:48 -0400)
committerSage Weil <sage@redhat.com>
Thu, 1 Oct 2015 13:39:32 +0000 (09:39 -0400)
If our cap locks us into a subdirectory (e.g., /foo), we will fail to
getattr on its parents (e.g., /).  This is expected.  Tolerate this case,
and warn that quotas may misbehave in that case (if they are set on one of
those parents).

Signed-off-by: Sage Weil <sage@redhat.com>
src/client/Client.cc

index e55b4d6a36691840f2fd0da70a81a07c4c3fd6fa..b81b5a0fa5472a6661b574a111de9bc7e2c56906 100644 (file)
@@ -5032,8 +5032,6 @@ int Client::mount(const std::string &mount_root, bool require_mds)
     }
   }
 
-  // hack: get+pin root inode.
-  //  fuse assumes it's always there.
   filepath fp(CEPH_INO_ROOT);
   if (!mount_root.empty())
     fp = filepath(mount_root.c_str());
@@ -5042,9 +5040,13 @@ int Client::mount(const std::string &mount_root, bool require_mds)
     req->set_filepath(fp);
     req->head.args.getattr.mask = CEPH_STAT_CAP_INODE_ALL;
     int res = make_request(req, -1, -1);
-    ldout(cct, 10) << "root getattr result=" << res << dendl;
-    if (res < 0)
+    if (res < 0) {
+      if (res == -EACCES && root) {
+       ldout(cct, 1) << __func__ << " EACCES on parent of mount point; quotas may not work" << dendl;
+       break;
+      }
       return res;
+    }
 
     if (fp.depth())
       fp.pop_dentry();
@@ -5052,7 +5054,6 @@ int Client::mount(const std::string &mount_root, bool require_mds)
       break;
   }
 
-  assert(root_ancestor->is_root());
   assert(root);
   _ll_get(root);