From: Sage Weil Date: Tue, 1 Sep 2015 20:48:17 +0000 (-0400) Subject: client: behave if we can't getattr parents of mount point X-Git-Tag: v10.0.0~123^2~68 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=807d36931f83e643e603f22d65e1ab3d6f550823;p=ceph.git client: behave if we can't getattr parents of mount point 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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index e55b4d6a3669..b81b5a0fa547 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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);