]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages: protect CephFS messages get/put methods 31330/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 1 Nov 2019 20:31:23 +0000 (13:31 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 4 Nov 2019 05:46:20 +0000 (21:46 -0800)
Use SafeMessage inheritance so that only intrusive pointers can modify
the reference count. This is just a defensive programming refactor.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
45 files changed:
src/messages/MCacheExpire.h
src/messages/MClientCapRelease.h
src/messages/MClientCaps.h
src/messages/MClientLease.h
src/messages/MClientQuota.h
src/messages/MClientReclaim.h
src/messages/MClientReclaimReply.h
src/messages/MClientReconnect.h
src/messages/MClientReply.h
src/messages/MClientRequest.h
src/messages/MClientRequestForward.h
src/messages/MClientSession.h
src/messages/MClientSnap.h
src/messages/MDentryLink.h
src/messages/MDentryUnlink.h
src/messages/MDirUpdate.h
src/messages/MDiscover.h
src/messages/MDiscoverReply.h
src/messages/MExportCaps.h
src/messages/MExportCapsAck.h
src/messages/MExportDir.h
src/messages/MExportDirAck.h
src/messages/MExportDirCancel.h
src/messages/MExportDirDiscover.h
src/messages/MExportDirDiscoverAck.h
src/messages/MExportDirFinish.h
src/messages/MExportDirNotify.h
src/messages/MExportDirNotifyAck.h
src/messages/MExportDirPrep.h
src/messages/MExportDirPrepAck.h
src/messages/MInodeFileCaps.h
src/messages/MLock.h
src/messages/MMDSCacheRejoin.h
src/messages/MMDSFindIno.h
src/messages/MMDSFindInoReply.h
src/messages/MMDSFragmentNotify.h
src/messages/MMDSFragmentNotifyAck.h
src/messages/MMDSMap.h
src/messages/MMDSOpenIno.h
src/messages/MMDSOpenInoReply.h
src/messages/MMDSResolve.h
src/messages/MMDSResolveAck.h
src/messages/MMDSSlaveRequest.h
src/messages/MMDSSnapUpdate.h
src/messages/MMDSTableRequest.h

index dede4f3fefef400434e115deba64b2541658f940..4645e813226324c01fb632e4dc30b3030acedec3 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "mds/mdstypes.h"
 
-class MCacheExpire : public Message {
+class MCacheExpire : public SafeMessage {
 private:
   __s32 from;
 
@@ -66,9 +66,9 @@ public:
   int get_from() const { return from; }
 
 protected:
-  MCacheExpire() : Message{MSG_MDS_CACHEEXPIRE}, from(-1) {}
+  MCacheExpire() : SafeMessage{MSG_MDS_CACHEEXPIRE}, from(-1) {}
   MCacheExpire(int f) : 
-    Message{MSG_MDS_CACHEEXPIRE},
+    SafeMessage{MSG_MDS_CACHEEXPIRE},
     from(f) { }
   ~MCacheExpire() override {}
 
index 10ff58f8ef3c1044043885d32de1c06730ee5145..f9442c981f1de71ba24e00b7a936dc019234cb42 100644 (file)
@@ -18,7 +18,7 @@
 #include "msg/Message.h"
 
 
-class MClientCapRelease : public Message {
+class MClientCapRelease : public SafeMessage {
  public:
   std::string_view get_type_name() const override { return "client_cap_release";}
   void print(ostream& out) const override {
@@ -56,7 +56,7 @@ private:
   static constexpr int COMPAT_VERSION = 1;
 
   MClientCapRelease() : 
-    Message{CEPH_MSG_CLIENT_CAPRELEASE, HEAD_VERSION, COMPAT_VERSION}
+    SafeMessage{CEPH_MSG_CLIENT_CAPRELEASE, HEAD_VERSION, COMPAT_VERSION}
   {
     memset(&head, 0, sizeof(head));
   }
index 292eeeb1845dc521715cbaefe25126fc20205bb9..99ef6a1954e9c05739640e691e4e0c225c7258d6 100644 (file)
@@ -19,7 +19,7 @@
 #include "mds/mdstypes.h"
 #include "include/ceph_features.h"
 
-class MClientCaps : public Message {
+class MClientCaps : public SafeMessage {
 private:
 
   static constexpr int HEAD_VERSION = 11;
@@ -129,7 +129,7 @@ private:
 
 protected:
   MClientCaps()
-    : Message{CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION} {}
+    : SafeMessage{CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION} {}
   MClientCaps(int op,
              inodeno_t ino,
              inodeno_t realm,
@@ -140,7 +140,7 @@ protected:
              int dirty,
              int mseq,
               epoch_t oeb)
-    : Message{CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION},
+    : SafeMessage{CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION},
       osd_epoch_barrier(oeb) {
     memset(&head, 0, sizeof(head));
     head.op = op;
@@ -157,7 +157,7 @@ protected:
   MClientCaps(int op,
              inodeno_t ino, inodeno_t realm,
              uint64_t id, int mseq, epoch_t oeb)
-    : Message{CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION},
+    : SafeMessage{CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION},
       osd_epoch_barrier(oeb) {
     memset(&head, 0, sizeof(head));
     head.op = op;
index f75cd26915b340359451f3d5491fb14a859eae2c..52c5883d58462ff088c27d59db5c56138b77f6f3 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "msg/Message.h"
 
-class MClientLease : public Message {
+class MClientLease : public SafeMessage {
 public:
   struct ceph_mds_lease h;
   std::string dname;
@@ -33,13 +33,13 @@ public:
   snapid_t get_last() const { return snapid_t(h.last); }
 
 protected:
-  MClientLease() : Message(CEPH_MSG_CLIENT_LEASE) {}
+  MClientLease() : SafeMessage(CEPH_MSG_CLIENT_LEASE) {}
   MClientLease(const MClientLease& m) :
-    Message(CEPH_MSG_CLIENT_LEASE),
+    SafeMessage(CEPH_MSG_CLIENT_LEASE),
     h(m.h),
     dname(m.dname) {}
   MClientLease(int ac, ceph_seq_t seq, int m, uint64_t i, uint64_t sf, uint64_t sl) :
-    Message(CEPH_MSG_CLIENT_LEASE) {
+    SafeMessage(CEPH_MSG_CLIENT_LEASE) {
     h.action = ac;
     h.seq = seq;
     h.mask = m;
@@ -49,7 +49,7 @@ protected:
     h.duration_ms = 0;
   }
   MClientLease(int ac, ceph_seq_t seq, int m, uint64_t i, uint64_t sf, uint64_t sl, std::string_view d) :
-    Message(CEPH_MSG_CLIENT_LEASE),
+    SafeMessage(CEPH_MSG_CLIENT_LEASE),
     dname(d) {
     h.action = ac;
     h.seq = seq;
index 0042f37fbffb834ee6c9120cca4d5b7c29420f42..817a88c13933e22750306c58bfb53fa46eba21f1 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "msg/Message.h"
 
-class MClientQuota : public Message {
+class MClientQuota : public SafeMessage {
 public:
   inodeno_t ino;
   nest_info_t rstat;
@@ -11,7 +11,7 @@ public:
 
 protected:
   MClientQuota() :
-    Message{CEPH_MSG_CLIENT_QUOTA},
+    SafeMessage{CEPH_MSG_CLIENT_QUOTA},
     ino(0)
   {}
   ~MClientQuota() override {}
index e98fee8e96099f28e2a4f940bdb1b15ffa85ee98..03bad8d6401dc4f870b76af25f483abba89c2542 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "msg/Message.h"
 
-class MClientReclaim: public Message {
+class MClientReclaim: public SafeMessage {
 public:
   static constexpr int HEAD_VERSION = 1;
   static constexpr int COMPAT_VERSION = 1;
@@ -49,9 +49,9 @@ public:
 
 protected:
   MClientReclaim() :
-    Message{CEPH_MSG_CLIENT_RECLAIM, HEAD_VERSION, COMPAT_VERSION} {}
+    SafeMessage{CEPH_MSG_CLIENT_RECLAIM, HEAD_VERSION, COMPAT_VERSION} {}
   MClientReclaim(std::string_view _uuid, uint32_t _flags) :
-    Message{CEPH_MSG_CLIENT_RECLAIM, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{CEPH_MSG_CLIENT_RECLAIM, HEAD_VERSION, COMPAT_VERSION},
     uuid(_uuid), flags(_flags) {}
 private:
   ~MClientReclaim() override {}
index ef0b17de9e8387e28f06a742cdafe13cf32b7d6b..b91b588b35fc41c28b817bd208d6cd3d5d658a9f 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "msg/Message.h"
 
-class MClientReclaimReply: public Message {
+class MClientReclaimReply: public SafeMessage {
 public:
   static constexpr int HEAD_VERSION = 1;
   static constexpr int COMPAT_VERSION = 1;
@@ -55,7 +55,7 @@ protected:
     MClientReclaimReply{0, 0}
   {}
   MClientReclaimReply(int r, epoch_t e=0) :
-    Message{CEPH_MSG_CLIENT_RECLAIM_REPLY, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{CEPH_MSG_CLIENT_RECLAIM_REPLY, HEAD_VERSION, COMPAT_VERSION},
     result(r), epoch(e) {}
 
 private:
index d631a697b579c77a09ba6587fa2195bd046b4fe2..e4592c7b01bf3fb20625f62c6da25d387552c9e6 100644 (file)
@@ -20,7 +20,7 @@
 #include "include/ceph_features.h"
 
 
-class MClientReconnect : public Message {
+class MClientReconnect : public SafeMessage {
 private:
   static constexpr int HEAD_VERSION = 5;
   static constexpr int COMPAT_VERSION = 4;
@@ -32,7 +32,7 @@ public:
 
 private:
   MClientReconnect() :
-    Message{CEPH_MSG_CLIENT_RECONNECT, HEAD_VERSION, COMPAT_VERSION} {}
+    SafeMessage{CEPH_MSG_CLIENT_RECONNECT, HEAD_VERSION, COMPAT_VERSION} {}
   ~MClientReconnect() override {}
 
   size_t cap_size = 0;
index c064ecbd2b32616886e86aed5fd1602d39f6f5b7..fb08b24c88a1ce37d6d585ed55a2d75d53e0a646 100644 (file)
@@ -263,7 +263,7 @@ struct InodeStat {
 };
 
 
-class MClientReply : public Message {
+class MClientReply : public SafeMessage {
 public:
   // reply data
   struct ceph_mds_reply_head head {};
@@ -287,9 +287,9 @@ public:
   bool is_safe() const { return head.safe; }
 
 protected:
-  MClientReply() : Message{CEPH_MSG_CLIENT_REPLY} {}
+  MClientReply() : SafeMessage{CEPH_MSG_CLIENT_REPLY} {}
   MClientReply(const MClientRequest &req, int result = 0) :
-    Message{CEPH_MSG_CLIENT_REPLY} {
+    SafeMessage{CEPH_MSG_CLIENT_REPLY} {
     memset(&head, 0, sizeof(head));
     header.tid = req.get_tid();
     head.op = req.get_op();
index 944cd8810c0e15b9cb01427efe7a5334f6312d19..d565f204ac50990983afd50b7ca547b41d6d4edf 100644 (file)
@@ -48,7 +48,7 @@
 
 // metadata ops.
 
-class MClientRequest : public Message {
+class MClientRequest : public SafeMessage {
 private:
   static constexpr int HEAD_VERSION = 4;
   static constexpr int COMPAT_VERSION = 1;
@@ -89,9 +89,9 @@ public:
 protected:
   // cons
   MClientRequest()
-    : Message(CEPH_MSG_CLIENT_REQUEST, HEAD_VERSION, COMPAT_VERSION) {}
+    : SafeMessage(CEPH_MSG_CLIENT_REQUEST, HEAD_VERSION, COMPAT_VERSION) {}
   MClientRequest(int op)
-    : Message(CEPH_MSG_CLIENT_REQUEST, HEAD_VERSION, COMPAT_VERSION) {
+    : SafeMessage(CEPH_MSG_CLIENT_REQUEST, HEAD_VERSION, COMPAT_VERSION) {
     memset(&head, 0, sizeof(head));
     head.op = op;
   }
index b92c49329e74b51dd5c472d97b1718317011d7d5..b0aeebebae87a8b7a4973b2a6cc89da04f77b18a 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "msg/Message.h"
 
-class MClientRequestForward : public Message {
+class MClientRequestForward : public SafeMessage {
 private:
   int32_t dest_mds;
   int32_t num_fwd;
@@ -26,10 +26,10 @@ private:
 
 protected:
   MClientRequestForward()
-    : Message{CEPH_MSG_CLIENT_REQUEST_FORWARD},
+    : SafeMessage{CEPH_MSG_CLIENT_REQUEST_FORWARD},
       dest_mds(-1), num_fwd(-1), client_must_resend(false) {}
   MClientRequestForward(ceph_tid_t t, int dm, int nf, bool cmr) :
-    Message{CEPH_MSG_CLIENT_REQUEST_FORWARD},
+    SafeMessage{CEPH_MSG_CLIENT_REQUEST_FORWARD},
     dest_mds(dm), num_fwd(nf), client_must_resend(cmr) {
     ceph_assert(client_must_resend);
     header.tid = t;
index f1d4191726c61be543976764bf3d2ed8f7fba6fa..9a4bba74b56ba47cf64c5ddcf8d441ba1e72a0b8 100644 (file)
@@ -18,7 +18,7 @@
 #include "msg/Message.h"
 #include "mds/mdstypes.h"
 
-class MClientSession : public Message {
+class MClientSession : public SafeMessage {
 private:
   static constexpr int HEAD_VERSION = 3;
   static constexpr int COMPAT_VERSION = 1;
@@ -36,15 +36,15 @@ public:
   int get_max_leases() const { return head.max_leases; }
 
 protected:
-  MClientSession() : Message{CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION} { }
+  MClientSession() : SafeMessage{CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION} { }
   MClientSession(int o, version_t s=0) : 
-    Message{CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION} {
+    SafeMessage{CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION} {
     memset(&head, 0, sizeof(head));
     head.op = o;
     head.seq = s;
   }
   MClientSession(int o, utime_t st) : 
-    Message{CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION} {
+    SafeMessage{CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION} {
     memset(&head, 0, sizeof(head));
     head.op = o;
     head.seq = 0;
index 59f872fc1a38f80a732b60e264376c66546f91f0..85c36af1bea4542f38073aa68b39bf9448fabfe1 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "msg/Message.h"
 
-class MClientSnap : public Message {
+class MClientSnap : public SafeMessage {
 public:
   ceph_mds_snap_head head;
   bufferlist bl;
@@ -28,7 +28,7 @@ public:
 
 protected:
   MClientSnap(int o=0) : 
-    Message{CEPH_MSG_CLIENT_SNAP} {
+    SafeMessage{CEPH_MSG_CLIENT_SNAP} {
     memset(&head, 0, sizeof(head));
     head.op = o;
   }
index 38cccf1fae1ba3b85bf6d1d9c245dd72ca5d5156..0b101683e83de46f9fa9fec3040fba37df33518c 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "msg/Message.h"
 
-class MDentryLink : public Message {
+class MDentryLink : public SafeMessage {
 private:
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
@@ -40,9 +40,9 @@ private:
 
 protected:
   MDentryLink() :
-    Message(MSG_MDS_DENTRYLINK, HEAD_VERSION, COMPAT_VERSION) { }
+    SafeMessage(MSG_MDS_DENTRYLINK, HEAD_VERSION, COMPAT_VERSION) { }
   MDentryLink(dirfrag_t r, dirfrag_t df, std::string_view n, bool p) :
-    Message(MSG_MDS_DENTRYLINK, HEAD_VERSION, COMPAT_VERSION),
+    SafeMessage(MSG_MDS_DENTRYLINK, HEAD_VERSION, COMPAT_VERSION),
     subtree(r),
     dirfrag(df),
     dn(n),
index acff7150f3f55975e3351fc2a46c91c6da4e1957..ee5d285ad44a96abcb9ee054589cdcf4a3264701 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "msg/Message.h"
 
-class MDentryUnlink : public Message {
+class MDentryUnlink : public SafeMessage {
 private:
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
@@ -37,9 +37,9 @@ private:
 
 protected:
   MDentryUnlink() :
-    Message(MSG_MDS_DENTRYUNLINK, HEAD_VERSION, COMPAT_VERSION) { }
+    SafeMessage(MSG_MDS_DENTRYUNLINK, HEAD_VERSION, COMPAT_VERSION) { }
   MDentryUnlink(dirfrag_t df, std::string_view n) :
-    Message(MSG_MDS_DENTRYUNLINK, HEAD_VERSION, COMPAT_VERSION),
+    SafeMessage(MSG_MDS_DENTRYUNLINK, HEAD_VERSION, COMPAT_VERSION),
     dirfrag(df),
     dn(n) {}
   ~MDentryUnlink() override {}
index e5f97f3847d236aa14f76a0a0c66eb8c05545c97..46036ad03e6cfa899adf623edb0a4022cd6772a4 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "msg/Message.h"
 
-class MDirUpdate : public Message {
+class MDirUpdate : public SafeMessage {
 public:
   mds_rank_t get_source_mds() const { return from_mds; }
   dirfrag_t get_dirfrag() const { return dirfrag; }
@@ -57,19 +57,19 @@ public:
 
 protected:
   ~MDirUpdate() {}
-  MDirUpdate() : Message(MSG_MDS_DIRUPDATE, HEAD_VERSION, COMPAT_VERSION) {}
+  MDirUpdate() : SafeMessage(MSG_MDS_DIRUPDATE, HEAD_VERSION, COMPAT_VERSION) {}
   MDirUpdate(mds_rank_t f,
             dirfrag_t dirfrag,
              int dir_rep,
              const std::set<int32_t>& dir_rep_by,
              filepath& path,
              bool discover = false) :
-    Message(MSG_MDS_DIRUPDATE, HEAD_VERSION, COMPAT_VERSION), from_mds(f), dirfrag(dirfrag),
+    SafeMessage(MSG_MDS_DIRUPDATE, HEAD_VERSION, COMPAT_VERSION), from_mds(f), dirfrag(dirfrag),
     dir_rep(dir_rep), dir_rep_by(dir_rep_by), path(path) {
     this->discover = discover ? 5 : 0;
   }
   MDirUpdate(const MDirUpdate& m)
-  : Message{MSG_MDS_DIRUPDATE},
+  : SafeMessage{MSG_MDS_DIRUPDATE},
     from_mds(m.from_mds),
     dirfrag(m.dirfrag),
     dir_rep(m.dir_rep),
index 0b54ad3e6f4b5245f20a55943aa0513199b30e69..e60ad738aa16c945ad8f2f3200031668bbaca1df 100644 (file)
@@ -22,7 +22,7 @@
 #include <string>
 
 
-class MDiscover : public Message {
+class MDiscover : public SafeMessage {
 private:
   static constexpr int HEAD_VERSION = 1;
   static constexpr int COMPAT_VERSION = 1;
@@ -50,14 +50,14 @@ private:
   void set_base_dir_frag(frag_t f) { base_dir_frag = f; }
 
 protected:
-  MDiscover() : Message(MSG_MDS_DISCOVER, HEAD_VERSION, COMPAT_VERSION) { }
+  MDiscover() : SafeMessage(MSG_MDS_DISCOVER, HEAD_VERSION, COMPAT_VERSION) { }
   MDiscover(inodeno_t base_ino_,
            frag_t base_frag_,
            snapid_t s,
             filepath& want_path_,
             bool want_base_dir_ = true,
            bool discover_xlocks_ = false) :
-    Message{MSG_MDS_DISCOVER},
+    SafeMessage{MSG_MDS_DISCOVER},
     base_ino(base_ino_),
     base_dir_frag(base_frag_),
     snapid(s),
index 8010320bdf7c9a62996943051dc156322104828f..70d417cb8c972efad62310de56965567cce9c60a 100644 (file)
@@ -63,7 +63,7 @@
  * 
  */
 
-class MDiscoverReply : public Message {
+class MDiscoverReply : public SafeMessage {
 private:
   static constexpr int HEAD_VERSION = 2;
   static constexpr int COMPAT_VERSION = 2;
@@ -110,9 +110,9 @@ private:
   void set_base_dir_frag(frag_t df) { base_dir_frag = df; }
 
 protected:
-  MDiscoverReply() : Message{MSG_MDS_DISCOVERREPLY, HEAD_VERSION, COMPAT_VERSION} { }
+  MDiscoverReply() : SafeMessage{MSG_MDS_DISCOVERREPLY, HEAD_VERSION, COMPAT_VERSION} { }
   MDiscoverReply(const MDiscover &dis) :
-    Message{MSG_MDS_DISCOVERREPLY, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{MSG_MDS_DISCOVERREPLY, HEAD_VERSION, COMPAT_VERSION},
     base_ino(dis.get_base_ino()),
     base_dir_frag(dis.get_base_dir_frag()),
     wanted_base_dir(dis.wants_base_dir()),
@@ -127,7 +127,7 @@ protected:
     header.tid = dis.get_tid();
   }
   MDiscoverReply(dirfrag_t df) :
-    Message{MSG_MDS_DISCOVERREPLY, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{MSG_MDS_DISCOVERREPLY, HEAD_VERSION, COMPAT_VERSION},
     base_ino(df.ino),
     base_dir_frag(df.frag),
     wanted_base_dir(false),
index c05836efe6a46c4944f5ef689b1bdf2faf7dd63c..90f9864a5f83032dc8a0492325e1c924110c6afb 100644 (file)
@@ -19,7 +19,7 @@
 #include "msg/Message.h"
 
 
-class MExportCaps : public Message {
+class MExportCaps : public SafeMessage {
 private:
   static constexpr int HEAD_VERSION = 2;
   static constexpr int COMPAT_VERSION = 1;
@@ -32,7 +32,7 @@ public:
 
 protected:
   MExportCaps() :
-    Message{MSG_MDS_EXPORTCAPS, HEAD_VERSION, COMPAT_VERSION} {}
+    SafeMessage{MSG_MDS_EXPORTCAPS, HEAD_VERSION, COMPAT_VERSION} {}
   ~MExportCaps() override {}
 
 public:
index 2382ba60d5b21682486d59a6a6de074935ea36a4..75ec3da37d715feb8f1e81b53afb535c8acb93fa 100644 (file)
@@ -19,7 +19,7 @@
 #include "msg/Message.h"
 
 
-class MExportCapsAck : public Message {
+class MExportCapsAck : public SafeMessage {
  static constexpr int HEAD_VERSION = 1;
  static constexpr int COMPAT_VERSION = 1;
 
@@ -29,9 +29,9 @@ public:
 
 protected:
   MExportCapsAck() :
-    Message{MSG_MDS_EXPORTCAPSACK, HEAD_VERSION, COMPAT_VERSION} {}
+    SafeMessage{MSG_MDS_EXPORTCAPSACK, HEAD_VERSION, COMPAT_VERSION} {}
   MExportCapsAck(inodeno_t i) :
-    Message{MSG_MDS_EXPORTCAPSACK, HEAD_VERSION, COMPAT_VERSION}, ino(i) {}
+    SafeMessage{MSG_MDS_EXPORTCAPSACK, HEAD_VERSION, COMPAT_VERSION}, ino(i) {}
   ~MExportCapsAck() override {}
 
 public:
index 3bd98a3387317dbceeb1c2519eab1215c54da3c9..b9e18188b36f0b1df2622f9be79a34acbf463065 100644 (file)
@@ -19,7 +19,7 @@
 #include "msg/Message.h"
 
 
-class MExportDir : public Message {
+class MExportDir : public SafeMessage {
 public:
   dirfrag_t dirfrag;
   bufferlist export_data;
@@ -27,9 +27,9 @@ public:
   bufferlist client_map;
 
 protected:
-  MExportDir() : Message{MSG_MDS_EXPORTDIR} {}
+  MExportDir() : SafeMessage{MSG_MDS_EXPORTDIR} {}
   MExportDir(dirfrag_t df, uint64_t tid) :
-    Message{MSG_MDS_EXPORTDIR}, dirfrag(df) {
+    SafeMessage{MSG_MDS_EXPORTDIR}, dirfrag(df) {
     set_tid(tid);
   }
   ~MExportDir() override {}
index d0ffd01b9c9a23c9aa7ab969938824a4702241db..8e3548cd39746660199f163c742f273023315a46 100644 (file)
@@ -18,7 +18,7 @@
 #include "MExportDir.h"
 #include "msg/Message.h"
 
-class MExportDirAck : public Message {
+class MExportDirAck : public SafeMessage {
 public:
   dirfrag_t dirfrag;
   bufferlist imported_caps;
@@ -26,9 +26,9 @@ public:
   dirfrag_t get_dirfrag() const { return dirfrag; }
   
 protected:
-  MExportDirAck() : Message{MSG_MDS_EXPORTDIRACK} {}
+  MExportDirAck() : SafeMessage{MSG_MDS_EXPORTDIRACK} {}
   MExportDirAck(dirfrag_t df, uint64_t tid) :
-    Message{MSG_MDS_EXPORTDIRACK}, dirfrag(df) {
+    SafeMessage{MSG_MDS_EXPORTDIRACK}, dirfrag(df) {
     set_tid(tid);
   }
   ~MExportDirAck() override {}
index 7e31c103d3dfe718c12d28da04f6090165da8e33..b26c3c0f37b646fe3472f62a70c545c6dd29b6d3 100644 (file)
@@ -18,7 +18,7 @@
 #include "msg/Message.h"
 #include "include/types.h"
 
-class MExportDirCancel : public Message {
+class MExportDirCancel : public SafeMessage {
 private:
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
@@ -28,9 +28,9 @@ private:
   dirfrag_t get_dirfrag() const { return dirfrag; }
 
 protected:
-  MExportDirCancel() : Message{MSG_MDS_EXPORTDIRCANCEL, HEAD_VERSION, COMPAT_VERSION} {}
+  MExportDirCancel() : SafeMessage{MSG_MDS_EXPORTDIRCANCEL, HEAD_VERSION, COMPAT_VERSION} {}
   MExportDirCancel(dirfrag_t df, uint64_t tid) :
-    Message{MSG_MDS_EXPORTDIRCANCEL, HEAD_VERSION, COMPAT_VERSION}, dirfrag(df) {
+    SafeMessage{MSG_MDS_EXPORTDIRCANCEL, HEAD_VERSION, COMPAT_VERSION}, dirfrag(df) {
     set_tid(tid);
   }
   ~MExportDirCancel() override {}
index 2de45c7140dd469b3aa8c0d856c44b3db60f5d82..d6f9cad1a0390f2c35af32853a2e3c2bbe5c80f6 100644 (file)
@@ -18,7 +18,7 @@
 #include "msg/Message.h"
 #include "include/types.h"
 
-class MExportDirDiscover : public Message {
+class MExportDirDiscover : public SafeMessage {
 private:
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
@@ -36,10 +36,10 @@ private:
 
 protected:
   MExportDirDiscover() :     
-    Message{MSG_MDS_EXPORTDIRDISCOVER, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{MSG_MDS_EXPORTDIRDISCOVER, HEAD_VERSION, COMPAT_VERSION},
     started(false) { }
   MExportDirDiscover(dirfrag_t df, filepath& p, mds_rank_t f, uint64_t tid) :
-    Message{MSG_MDS_EXPORTDIRDISCOVER, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{MSG_MDS_EXPORTDIRDISCOVER, HEAD_VERSION, COMPAT_VERSION},
     from(f), dirfrag(df), path(p), started(false) {
     set_tid(tid);
   }
index 09633b4cfaf0c29c68619bfbb744173ee7ed3fb4..e71e2898bd601c846b1297b625ed57b5379d92da 100644 (file)
@@ -18,7 +18,7 @@
 #include "msg/Message.h"
 #include "include/types.h"
 
-class MExportDirDiscoverAck : public Message {
+class MExportDirDiscoverAck : public SafeMessage {
 private:
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
@@ -32,9 +32,9 @@ private:
   bool is_success() const { return success; }
 
 protected:
-  MExportDirDiscoverAck() : Message{MSG_MDS_EXPORTDIRDISCOVERACK, HEAD_VERSION, COMPAT_VERSION} {}
+  MExportDirDiscoverAck() : SafeMessage{MSG_MDS_EXPORTDIRDISCOVERACK, HEAD_VERSION, COMPAT_VERSION} {}
   MExportDirDiscoverAck(dirfrag_t df, uint64_t tid, bool s=true) :
-    Message{MSG_MDS_EXPORTDIRDISCOVERACK, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{MSG_MDS_EXPORTDIRDISCOVERACK, HEAD_VERSION, COMPAT_VERSION},
     dirfrag(df), success(s) {
     set_tid(tid);
   }
index 8a73c40de5f6990168ab52049e519be8d430ab9f..579f34bd74fb51fa97f53b948270fc33456b7347 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "msg/Message.h"
 
-class MExportDirFinish : public Message {
+class MExportDirFinish : public SafeMessage {
 private:
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
@@ -31,9 +31,9 @@ private:
   
 protected:
   MExportDirFinish() :
-    Message{MSG_MDS_EXPORTDIRFINISH, HEAD_VERSION, COMPAT_VERSION}, last(false) {}
+    SafeMessage{MSG_MDS_EXPORTDIRFINISH, HEAD_VERSION, COMPAT_VERSION}, last(false) {}
   MExportDirFinish(dirfrag_t df, bool l, uint64_t tid) :
-    Message{MSG_MDS_EXPORTDIRFINISH, HEAD_VERSION, COMPAT_VERSION}, dirfrag(df), last(l) {
+    SafeMessage{MSG_MDS_EXPORTDIRFINISH, HEAD_VERSION, COMPAT_VERSION}, dirfrag(df), last(l) {
     set_tid(tid);
   }
   ~MExportDirFinish() override {}
index 10962afe818dd76c7b955c53e21ed12f4aa29829..a33881882ce969502e8496fca9e4a68041fbe911 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "msg/Message.h"
 
-class MExportDirNotify : public Message {
+class MExportDirNotify : public SafeMessage {
 private:
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
@@ -37,9 +37,9 @@ private:
 
 protected:
   MExportDirNotify() :
-    Message{MSG_MDS_EXPORTDIRNOTIFY, HEAD_VERSION, COMPAT_VERSION} {}
+    SafeMessage{MSG_MDS_EXPORTDIRNOTIFY, HEAD_VERSION, COMPAT_VERSION} {}
   MExportDirNotify(dirfrag_t i, uint64_t tid, bool a, pair<__s32,__s32> oa, pair<__s32,__s32> na) :
-    Message{MSG_MDS_EXPORTDIRNOTIFY, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{MSG_MDS_EXPORTDIRNOTIFY, HEAD_VERSION, COMPAT_VERSION},
     base(i), ack(a), old_auth(oa), new_auth(na) {
     set_tid(tid);
   }
index 06796fc15108c86efbd342565b2a181a50ebb18a..5bb6616fd34cd139864f125b4be33872adda0f31 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "msg/Message.h"
 
-class MExportDirNotifyAck : public Message {
+class MExportDirNotifyAck : public SafeMessage {
 private:
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
@@ -31,9 +31,9 @@ private:
   
 protected:
   MExportDirNotifyAck() :
-    Message{MSG_MDS_EXPORTDIRNOTIFYACK, HEAD_VERSION, COMPAT_VERSION} {}
+    SafeMessage{MSG_MDS_EXPORTDIRNOTIFYACK, HEAD_VERSION, COMPAT_VERSION} {}
   MExportDirNotifyAck(dirfrag_t df, uint64_t tid, pair<__s32,__s32> na) :
-    Message{MSG_MDS_EXPORTDIRNOTIFYACK, HEAD_VERSION, COMPAT_VERSION}, dirfrag(df), new_auth(na) {
+    SafeMessage{MSG_MDS_EXPORTDIRNOTIFYACK, HEAD_VERSION, COMPAT_VERSION}, dirfrag(df), new_auth(na) {
     set_tid(tid);
   }
   ~MExportDirNotifyAck() override {}
index f98fbc385d1b50fe9f9f2a7216d137e99c9795fd..7500c5ab070b9fa8efff333194150945715f2ea6 100644 (file)
@@ -19,7 +19,7 @@
 #include "msg/Message.h"
 #include "include/types.h"
 
-class MExportDirPrep : public Message {
+class MExportDirPrep : public SafeMessage {
 private:
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
@@ -44,7 +44,7 @@ public:
 protected:
   MExportDirPrep() = default;
   MExportDirPrep(dirfrag_t df, uint64_t tid) :
-    Message{MSG_MDS_EXPORTDIRPREP, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{MSG_MDS_EXPORTDIRPREP, HEAD_VERSION, COMPAT_VERSION},
     dirfrag(df)
   {
     set_tid(tid);
index 217d13e4ac46876b8f62f3a44bc21bd1d6d31f50..1792185e95b319cb7d4c152565173d1092eabd54 100644 (file)
@@ -18,7 +18,7 @@
 #include "msg/Message.h"
 #include "include/types.h"
 
-class MExportDirPrepAck : public Message {
+class MExportDirPrepAck : public SafeMessage {
 private:
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
@@ -31,9 +31,9 @@ private:
 
 protected:
   MExportDirPrepAck() :
-    Message{MSG_MDS_EXPORTDIRPREPACK, HEAD_VERSION, COMPAT_VERSION} {}
+    SafeMessage{MSG_MDS_EXPORTDIRPREPACK, HEAD_VERSION, COMPAT_VERSION} {}
   MExportDirPrepAck(dirfrag_t df, bool s, uint64_t tid) :
-    Message{MSG_MDS_EXPORTDIRPREPACK, HEAD_VERSION, COMPAT_VERSION}, dirfrag(df), success(s) {
+    SafeMessage{MSG_MDS_EXPORTDIRPREPACK, HEAD_VERSION, COMPAT_VERSION}, dirfrag(df), success(s) {
     set_tid(tid);
   }
   ~MExportDirPrepAck() override {}
index ab02f66286e29c00bc9c98d7030df5ff78820e23..506594d34ae10d3911204dff11d4e982e449e7d4 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "msg/Message.h"
 
-class MInodeFileCaps : public Message {
+class MInodeFileCaps : public SafeMessage {
 private:
   static constexpr int HEAD_VERSION = 1;
   static constexpr int COMPAT_VERSION = 1;
@@ -30,9 +30,9 @@ public:
   int       get_caps() const { return caps; }
 
 protected:
-  MInodeFileCaps() : Message(MSG_MDS_INODEFILECAPS, HEAD_VERSION, COMPAT_VERSION) {}
+  MInodeFileCaps() : SafeMessage(MSG_MDS_INODEFILECAPS, HEAD_VERSION, COMPAT_VERSION) {}
   MInodeFileCaps(inodeno_t ino, int caps) :
-    Message(MSG_MDS_INODEFILECAPS, HEAD_VERSION, COMPAT_VERSION) {
+    SafeMessage(MSG_MDS_INODEFILECAPS, HEAD_VERSION, COMPAT_VERSION) {
     this->ino = ino;
     this->caps = caps;
   }
index 1b284cdb2d2908967bd00f288adeba308541e61e..76a57feaa84937ed904b1726e3038c2ec2913741 100644 (file)
@@ -20,7 +20,7 @@
 #include "mds/locks.h"
 #include "mds/SimpleLock.h"
 
-class MLock : public Message {
+class MLock : public SafeMessage {
 private:
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
@@ -46,19 +46,19 @@ public:
   MDSCacheObjectInfo &get_object_info() { return object_info; }
 
 protected:
-  MLock() : Message{MSG_MDS_LOCK, HEAD_VERSION, COMPAT_VERSION} {}
+  MLock() : SafeMessage{MSG_MDS_LOCK, HEAD_VERSION, COMPAT_VERSION} {}
   MLock(int ac, mds_rank_t as) :
-    Message{MSG_MDS_LOCK, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{MSG_MDS_LOCK, HEAD_VERSION, COMPAT_VERSION},
     action(ac), asker(as),
     lock_type(0) { }
   MLock(SimpleLock *lock, int ac, mds_rank_t as) :
-    Message{MSG_MDS_LOCK, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{MSG_MDS_LOCK, HEAD_VERSION, COMPAT_VERSION},
     action(ac), asker(as),
     lock_type(lock->get_type()) {
     lock->get_parent()->set_object_info(object_info);
   }
   MLock(SimpleLock *lock, int ac, mds_rank_t as, bufferlist& bl) :
-    Message{MSG_MDS_LOCK, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{MSG_MDS_LOCK, HEAD_VERSION, COMPAT_VERSION},
     action(ac), asker(as), lock_type(lock->get_type()) {
     lock->get_parent()->set_object_info(object_info);
     lockdata.claim(bl);
index a4171183256783120542690375e2911e7cefc182..8a8f35a886d0061d006c707c1511d4b18cf01a7b 100644 (file)
@@ -27,7 +27,7 @@
 
 // sent from replica to auth
 
-class MMDSCacheRejoin : public Message {
+class MMDSCacheRejoin : public SafeMessage {
 public:
   static constexpr int OP_WEAK    = 1;  // replica -> auth, i exist, + maybe open files.
   static constexpr int OP_STRONG  = 2;  // replica -> auth, i exist, + open files and lock state.
@@ -348,7 +348,7 @@ private:
   static constexpr int COMPAT_VERSION = 1;
 
   MMDSCacheRejoin(int o) : MMDSCacheRejoin() { op = o; }
-  MMDSCacheRejoin() : Message{MSG_MDS_CACHEREJOIN, HEAD_VERSION, COMPAT_VERSION} {}
+  MMDSCacheRejoin() : SafeMessage{MSG_MDS_CACHEREJOIN, HEAD_VERSION, COMPAT_VERSION} {}
   ~MMDSCacheRejoin() override {}
 };
 
index 49737ee2191fc58b47b90dd0ecc4fc2694c030eb..1c14f5be7cb3539724760d725131c887ca697793 100644 (file)
@@ -18,7 +18,7 @@
 #include "msg/Message.h"
 #include "include/filepath.h"
 
-class MMDSFindIno : public Message {
+class MMDSFindIno : public SafeMessage {
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
 public:
@@ -26,8 +26,8 @@ public:
   inodeno_t ino;
 
 protected:
-  MMDSFindIno() : Message{MSG_MDS_FINDINO, HEAD_VERSION, COMPAT_VERSION} {}
-  MMDSFindIno(ceph_tid_t t, inodeno_t i) : Message{MSG_MDS_FINDINO, HEAD_VERSION, COMPAT_VERSION}, tid(t), ino(i) {}
+  MMDSFindIno() : SafeMessage{MSG_MDS_FINDINO, HEAD_VERSION, COMPAT_VERSION} {}
+  MMDSFindIno(ceph_tid_t t, inodeno_t i) : SafeMessage{MSG_MDS_FINDINO, HEAD_VERSION, COMPAT_VERSION}, tid(t), ino(i) {}
   ~MMDSFindIno() override {}
 
 public:
index dfb2202e4cc93b96291b47e281cc0ed352a5ac6e..7fe13bb5cd2e61b4e5ade73307a1e6d1bd7b44b8 100644 (file)
@@ -18,7 +18,7 @@
 #include "msg/Message.h"
 #include "include/filepath.h"
 
-class MMDSFindInoReply : public Message {
+class MMDSFindInoReply : public SafeMessage {
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
 public:
@@ -26,8 +26,8 @@ public:
   filepath path;
 
 protected:
-  MMDSFindInoReply() : Message{MSG_MDS_FINDINOREPLY, HEAD_VERSION, COMPAT_VERSION} {}
-  MMDSFindInoReply(ceph_tid_t t) : Message{MSG_MDS_FINDINOREPLY, HEAD_VERSION, COMPAT_VERSION}, tid(t) {}
+  MMDSFindInoReply() : SafeMessage{MSG_MDS_FINDINOREPLY, HEAD_VERSION, COMPAT_VERSION} {}
+  MMDSFindInoReply(ceph_tid_t t) : SafeMessage{MSG_MDS_FINDINOREPLY, HEAD_VERSION, COMPAT_VERSION}, tid(t) {}
   ~MMDSFindInoReply() override {}
 
 public:
index 3a12ccb11e3e0b8d6a2d9987fc1b0bd316eba5c8..9a896f1177d85eeb0dd760be3828720ea4476b15 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "msg/Message.h"
 
-class MMDSFragmentNotify : public Message {
+class MMDSFragmentNotify : public SafeMessage {
 private:
   static constexpr int HEAD_VERSION = 2;
   static constexpr int COMPAT_VERSION = 1;
@@ -38,9 +38,9 @@ private:
 
 protected:
   MMDSFragmentNotify() :
-    Message{MSG_MDS_FRAGMENTNOTIFY, HEAD_VERSION, COMPAT_VERSION} {}
+    SafeMessage{MSG_MDS_FRAGMENTNOTIFY, HEAD_VERSION, COMPAT_VERSION} {}
   MMDSFragmentNotify(dirfrag_t df, int b, uint64_t tid) :
-    Message{MSG_MDS_FRAGMENTNOTIFY, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{MSG_MDS_FRAGMENTNOTIFY, HEAD_VERSION, COMPAT_VERSION},
     base_dirfrag(df), bits(b) {
     set_tid(tid);
   }
index a067dfc36d2e1f0ed2c71481ff05ff8c890b49d9..e78a0f2df26105bf71363b9bc5adf6704f112e3d 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "msg/Message.h"
 
-class MMDSFragmentNotifyAck : public Message {
+class MMDSFragmentNotifyAck : public SafeMessage {
 private:
   dirfrag_t base_dirfrag;
   int8_t bits = 0;
@@ -29,9 +29,9 @@ private:
   bufferlist basebl;
 
 protected:
-  MMDSFragmentNotifyAck() : Message{MSG_MDS_FRAGMENTNOTIFYACK} {}
+  MMDSFragmentNotifyAck() : SafeMessage{MSG_MDS_FRAGMENTNOTIFYACK} {}
   MMDSFragmentNotifyAck(dirfrag_t df, int b, uint64_t tid) :
-    Message{MSG_MDS_FRAGMENTNOTIFYACK},
+    SafeMessage{MSG_MDS_FRAGMENTNOTIFYACK},
     base_dirfrag(df), bits(b) {
     set_tid(tid);
   }
index ed10459ef62b7d74207d5accab05ef6a91b6a37b..31bff0066295fdaa44fc7e4dd96949d0e83008e9 100644 (file)
@@ -20,7 +20,7 @@
 #include "mds/MDSMap.h"
 #include "include/ceph_features.h"
 
-class MMDSMap : public Message {
+class MMDSMap : public SafeMessage {
 private:
   static constexpr int HEAD_VERSION = 1;
   static constexpr int COMPAT_VERSION = 1;
@@ -34,9 +34,9 @@ public:
 
 protected:
   MMDSMap() : 
-    Message{CEPH_MSG_MDS_MAP, HEAD_VERSION, COMPAT_VERSION} {}
+    SafeMessage{CEPH_MSG_MDS_MAP, HEAD_VERSION, COMPAT_VERSION} {}
   MMDSMap(const uuid_d &f, const MDSMap &mm) :
-    Message{CEPH_MSG_MDS_MAP, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{CEPH_MSG_MDS_MAP, HEAD_VERSION, COMPAT_VERSION},
     fsid(f) {
     epoch = mm.get_epoch();
     mm.encode(encoded, -1);  // we will reencode with fewer features as necessary
index 7182c8055521198692fc29f749621ec818293631..e37f070eb5dfeff5cb16fc488610c8249345fc96 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "msg/Message.h"
 
-class MMDSOpenIno : public Message {
+class MMDSOpenIno : public SafeMessage {
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
 public:
@@ -25,9 +25,9 @@ public:
   vector<inode_backpointer_t> ancestors;
 
 protected:
-  MMDSOpenIno() : Message{MSG_MDS_OPENINO, HEAD_VERSION, COMPAT_VERSION} {}
+  MMDSOpenIno() : SafeMessage{MSG_MDS_OPENINO, HEAD_VERSION, COMPAT_VERSION} {}
   MMDSOpenIno(ceph_tid_t t, inodeno_t i, vector<inode_backpointer_t>* pa) :
-    Message{MSG_MDS_OPENINO, HEAD_VERSION, COMPAT_VERSION}, ino(i) {
+    SafeMessage{MSG_MDS_OPENINO, HEAD_VERSION, COMPAT_VERSION}, ino(i) {
     header.tid = t;
     if (pa)
       ancestors = *pa;
index 521065ea3928ef28dac8a853af3fc1d994df4d8f..37eae8285254ae3a2ec2a7d728a8eb2396f04d5a 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "msg/Message.h"
 
-class MMDSOpenInoReply : public Message {
+class MMDSOpenInoReply : public SafeMessage {
 public:
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
@@ -27,9 +27,9 @@ public:
   int32_t error;
 
 protected:
-  MMDSOpenInoReply() : Message{MSG_MDS_OPENINOREPLY, HEAD_VERSION, COMPAT_VERSION}, error(0) {}
+  MMDSOpenInoReply() : SafeMessage{MSG_MDS_OPENINOREPLY, HEAD_VERSION, COMPAT_VERSION}, error(0) {}
   MMDSOpenInoReply(ceph_tid_t t, inodeno_t i, mds_rank_t h=MDS_RANK_NONE, int e=0) :
-    Message{MSG_MDS_OPENINOREPLY, HEAD_VERSION, COMPAT_VERSION}, ino(i), hint(h), error(e) {
+    SafeMessage{MSG_MDS_OPENINOREPLY, HEAD_VERSION, COMPAT_VERSION}, ino(i), hint(h), error(e) {
     header.tid = t;
   }
 
index bd1148c337c631cc7f783f2f39aabeedc1ade2ac..ec03c22922ca1a2490450bb80523c37489484dd7 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "mds/Capability.h"
 
-class MMDSResolve : public Message {
+class MMDSResolve : public SafeMessage {
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
 
@@ -96,7 +96,7 @@ public:
   list<table_client> table_clients;
 
 protected:
-  MMDSResolve() : Message{MSG_MDS_RESOLVE, HEAD_VERSION, COMPAT_VERSION}
+  MMDSResolve() : SafeMessage{MSG_MDS_RESOLVE, HEAD_VERSION, COMPAT_VERSION}
  {}
   ~MMDSResolve() override {}
 
index cea45cb7ee6b8a1885aa2171c3645b0b1ff33381..76599d0944fc8984c1b523a46a7d55fe65e465bf 100644 (file)
@@ -20,7 +20,7 @@
 #include "include/types.h"
 
 
-class MMDSResolveAck : public Message {
+class MMDSResolveAck : public SafeMessage {
   static const int HEAD_VERSION = 1;
   static const int COMPAT_VERSION = 1;
 public:
@@ -28,7 +28,7 @@ public:
   vector<metareqid_t> abort;
 
 protected:
-  MMDSResolveAck() : Message{MSG_MDS_RESOLVEACK, HEAD_VERSION, COMPAT_VERSION} {}
+  MMDSResolveAck() : SafeMessage{MSG_MDS_RESOLVEACK, HEAD_VERSION, COMPAT_VERSION} {}
   ~MMDSResolveAck() override {}
 
 public:
index ee4a7f55f648b8bb929869a84c1df87f8c9e7c37..a59a79ac76f42a57db0b9fac7bf174fb8d426011 100644 (file)
@@ -19,7 +19,7 @@
 #include "msg/Message.h"
 #include "mds/mdstypes.h"
 
-class MMDSSlaveRequest : public Message {
+class MMDSSlaveRequest : public SafeMessage {
   static constexpr int HEAD_VERSION = 1;
   static constexpr int COMPAT_VERSION = 1;
 public:
@@ -158,9 +158,9 @@ public:
   bufferlist& get_lock_data() { return inode_export; }
 
 protected:
-  MMDSSlaveRequest() : Message{MSG_MDS_SLAVE_REQUEST, HEAD_VERSION, COMPAT_VERSION} { }
+  MMDSSlaveRequest() : SafeMessage{MSG_MDS_SLAVE_REQUEST, HEAD_VERSION, COMPAT_VERSION} { }
   MMDSSlaveRequest(metareqid_t ri, __u32 att, int o) : 
-    Message{MSG_MDS_SLAVE_REQUEST, HEAD_VERSION, COMPAT_VERSION},
+    SafeMessage{MSG_MDS_SLAVE_REQUEST, HEAD_VERSION, COMPAT_VERSION},
     reqid(ri), attempt(att), op(o), flags(0), lock_type(0),
     inode_export_v(0), srcdn_auth(MDS_RANK_NONE) { }
   ~MMDSSlaveRequest() override {}
index d63f1a55cc15661cf1cf702d2099745f518d0caa..13847498ace663ad98ca96661ab614e3d63621d0 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "msg/Message.h"
 
-class MMDSSnapUpdate : public Message {
+class MMDSSnapUpdate : public SafeMessage {
 private:
   inodeno_t ino;
   __s16 snap_op;
@@ -29,9 +29,9 @@ public:
   bufferlist snap_blob;
 
 protected:
-  MMDSSnapUpdate() : Message{MSG_MDS_SNAPUPDATE} {}
+  MMDSSnapUpdate() : SafeMessage{MSG_MDS_SNAPUPDATE} {}
   MMDSSnapUpdate(inodeno_t i, version_t tid, int op) :
-    Message{MSG_MDS_SNAPUPDATE}, ino(i), snap_op(op) {
+    SafeMessage{MSG_MDS_SNAPUPDATE}, ino(i), snap_op(op) {
       set_tid(tid);
     }
   ~MMDSSnapUpdate() override {}
index 0d929f7961a2769953643b741b4f242c6c9e42c6..01254d0bbb021a1553325e273400363a13235ed7 100644 (file)
@@ -19,7 +19,7 @@
 #include "msg/Message.h"
 #include "mds/mds_table_types.h"
 
-class MMDSTableRequest : public Message {
+class MMDSTableRequest : public SafeMessage {
 public:
   __u16 table = 0;
   __s16 op = 0;
@@ -27,9 +27,9 @@ public:
   bufferlist bl;
 
 protected:
-  MMDSTableRequest() : Message{MSG_MDS_TABLE_REQUEST} {}
+  MMDSTableRequest() : SafeMessage{MSG_MDS_TABLE_REQUEST} {}
   MMDSTableRequest(int tab, int o, uint64_t r, version_t v=0) : 
-    Message{MSG_MDS_TABLE_REQUEST},
+    SafeMessage{MSG_MDS_TABLE_REQUEST},
     table(tab), op(o), reqid(r) {
     set_tid(v);
   }