From: Greg Farnum Date: Thu, 8 Sep 2016 02:37:48 +0000 (-0700) Subject: client: include UserPerm contents in may_* debug output X-Git-Tag: v11.0.1~36^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=550a59dd3c67efd36ebd16cdadc966926c74d95d;p=ceph.git client: include UserPerm contents in may_* debug output Signed-off-by: Greg Farnum --- diff --git a/src/client/Client.cc b/src/client/Client.cc index f05bfb3e81d4..10de03cabba1 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -5059,8 +5059,14 @@ out: return r; } +ostream& operator<<(ostream &out, const UserPerm& perm) { + out << "UserPerm(uid: " << perm.uid() << ", gid: " << perm.gid() << ")"; + return out; +} + int Client::may_setattr(Inode *in, struct stat *st, int mask, const UserPerm& perms) { + ldout(cct, 20) << __func__ << *in << "; " << perms << dendl; int r = _getattr_for_perm(in, perms); if (r < 0) goto out; @@ -5115,6 +5121,7 @@ out: int Client::may_open(Inode *in, int flags, const UserPerm& perms) { + ldout(cct, 20) << __func__ << *in << "; " << perms << dendl; unsigned want = 0; if ((flags & O_ACCMODE) == O_WRONLY) @@ -5151,6 +5158,7 @@ out: int Client::may_lookup(Inode *dir, const UserPerm& perms) { + ldout(cct, 20) << __func__ << *dir << "; " << perms << dendl; int r = _getattr_for_perm(dir, perms); if (r < 0) goto out; @@ -5163,6 +5171,7 @@ out: int Client::may_create(Inode *dir, const UserPerm& perms) { + ldout(cct, 20) << __func__ << *dir << "; " << perms << dendl; int r = _getattr_for_perm(dir, perms); if (r < 0) goto out; @@ -5175,6 +5184,7 @@ out: int Client::may_delete(Inode *dir, const char *name, const UserPerm& perms) { + ldout(cct, 20) << __func__ << *dir << "; " << "; name " << name << "; " << perms << dendl; int r = _getattr_for_perm(dir, perms); if (r < 0) goto out; @@ -5199,6 +5209,7 @@ out: int Client::may_hardlink(Inode *in, const UserPerm& perms) { + ldout(cct, 20) << __func__ << *in << "; " << perms << dendl; int r = _getattr_for_perm(in, perms); if (r < 0) goto out; diff --git a/src/client/UserPerm.h b/src/client/UserPerm.h index 37377eb50ed3..b1af6cdaec16 100644 --- a/src/client/UserPerm.h +++ b/src/client/UserPerm.h @@ -77,5 +77,4 @@ public: void take_gids() { alloced_gids = true; } }; - #endif