From: Jeff Layton Date: Fri, 14 Oct 2016 14:59:27 +0000 (-0400) Subject: client: no need to check mask before calling _getattr in statx X-Git-Tag: v11.1.0~625^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e3958efcbb220fa1eecd33e4061a9da882956a3f;p=ceph.git 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 --- 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);