From 39f4f159fdb84662adb2eaa4017479c767f2f555 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Wed, 12 Oct 2016 07:04:41 -0400 Subject: [PATCH] client: fix caps handling when calling _ll_getattr The _ll_getattr was hardcoded to request CEPH_STAT_CAP_INODE_ALL, even when the caller didn't need that many caps. Have it take a caps mask as a parameter and pass that through to _getattr. Signed-off-by: Jeff Layton --- src/client/Client.cc | 8 ++++---- src/client/Client.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 5d96bda9e22..48620577ec1 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -9905,7 +9905,7 @@ Inode *Client::ll_get_inode(vinodeno_t vino) return in; } -int Client::_ll_getattr(Inode *in, const UserPerm& perms) +int Client::_ll_getattr(Inode *in, int caps, const UserPerm& perms) { vinodeno_t vino = _get_vino(in); @@ -9916,14 +9916,14 @@ int Client::_ll_getattr(Inode *in, const UserPerm& perms) if (vino.snapid < CEPH_NOSNAP) return 0; else - return _getattr(in, CEPH_STAT_CAP_INODE_ALL, perms); + return _getattr(in, caps, perms); } int Client::ll_getattr(Inode *in, struct stat *attr, const UserPerm& perms) { Mutex::Locker lock(client_lock); - int res = _ll_getattr(in, perms); + int res = _ll_getattr(in, CEPH_STAT_CAP_INODE_ALL, perms); if (res == 0) fill_stat(in, attr); @@ -9940,7 +9940,7 @@ int Client::ll_getattrx(Inode *in, struct ceph_statx *stx, unsigned int want, unsigned mask = statx_to_mask(flags, want); if (mask && !in->caps_issued_mask(mask)) - res = _ll_getattr(in, perms); + res = _ll_getattr(in, mask, perms); if (res == 0) fill_statx(in, mask, stx); diff --git a/src/client/Client.h b/src/client/Client.h index 9cb4a693e52..353771cb1c0 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -921,7 +921,7 @@ private: mds_rank_t _get_random_up_mds() const; - int _ll_getattr(Inode *in, const UserPerm& perms); + int _ll_getattr(Inode *in, int caps, const UserPerm& perms); public: int mount(const std::string &mount_root, const UserPerm& perms, -- 2.39.5