]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: include UserPerm contents in may_* debug output
authorGreg Farnum <gfarnum@redhat.com>
Thu, 8 Sep 2016 02:37:48 +0000 (19:37 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Wed, 21 Sep 2016 23:33:57 +0000 (16:33 -0700)
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/client/Client.cc
src/client/UserPerm.h

index f05bfb3e81d484b415f927bf58f4e3c793d029dd..10de03cabba1bec985c3bf6b7aa25598543eea0c 100644 (file)
@@ -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;
index 37377eb50ed3695079e8185eae84b016c08828c5..b1af6cdaec1677536dd4583162fa5f93b0cca02d 100644 (file)
@@ -77,5 +77,4 @@ public:
   void take_gids() { alloced_gids = true; }
 };
 
-
 #endif