From e3958efcbb220fa1eecd33e4061a9da882956a3f Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Fri, 14 Oct 2016 10:59:27 -0400 Subject: [PATCH] client: no need to check mask before calling _getattr in statx If the mask is zero, then the cap check will succeed, "yes" will be true and we'll end up returning quickly from _getattr anyway. Signed-off-by: Jeff Layton --- src/client/Client.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 5ec790b0469b..1284c1679fe8 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -6742,12 +6742,10 @@ int Client::statx(const char *relpath, struct ceph_statx *stx, if (r < 0) return r; - if (mask && !in->caps_issued_mask(mask)) { - r = _getattr(in, mask, perms); - if (r < 0) { - ldout(cct, 3) << "statx exit on error!" << dendl; - return r; - } + r = _getattr(in, mask, perms); + if (r < 0) { + ldout(cct, 3) << "statx exit on error!" << dendl; + return r; } fill_statx(in, mask, stx); -- 2.47.3