]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: add cap_auths in MClientSession
authorXiubo Li <xiubli@redhat.com>
Mon, 5 Dec 2022 07:26:28 +0000 (15:26 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 27 Mar 2024 00:42:40 +0000 (08:42 +0800)
It will include the uid/gids and path in each cap_auth.

Fixes: https://tracker.ceph.com/issues/57154
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 213a27aab0455c83284bdb2187540e4895b18e6d)

src/messages/MClientSession.h

index 32ad6712d6ca7865dc9f374d9936167f1be8add9..8f6e47acf1dfc8612fde1d399bbcc6e932ababdf 100644 (file)
 #ifndef CEPH_MCLIENTSESSION_H
 #define CEPH_MCLIENTSESSION_H
 
+#include "mds/MDSAuthCaps.h"
 #include "msg/Message.h"
 #include "mds/mdstypes.h"
 
 class MClientSession final : public SafeMessage {
 private:
-  static constexpr int HEAD_VERSION = 5;
+  static constexpr int HEAD_VERSION = 6;
   static constexpr int COMPAT_VERSION = 1;
 
 public:
@@ -31,6 +32,7 @@ public:
   std::map<std::string, std::string> metadata;
   feature_bitset_t supported_features;
   metric_spec_t metric_spec;
+  std::vector<MDSCapAuth> cap_auths;
 
   int get_op() const { return head.op; }
   version_t get_seq() const { return head.seq; }
@@ -64,6 +66,8 @@ public:
       out << " seq " << get_seq();
     if (get_op() == CEPH_SESSION_RECALL_STATE)
       out << " max_caps " << head.max_caps << " max_leases " << head.max_leases;
+    if (!cap_auths.empty())
+      out << " cap_auths " << cap_auths;
     out << ")";
   }
 
@@ -81,6 +85,9 @@ public:
     if (header.version >= 5) {
       decode(flags, p);
     }
+    if (header.version >= 6) {
+      decode(cap_auths, p);
+    }
   }
   void encode_payload(uint64_t features) override { 
     using ceph::encode;
@@ -96,6 +103,7 @@ public:
       encode(supported_features, payload);
       encode(metric_spec, payload);
       encode(flags, payload);
+      encode(cap_auths, payload);
     }
   }
 private: