]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include/denc.h: Review fixes 58650/head
authorAdam Kupczyk <akupczyk@ibm.com>
Tue, 16 Jul 2024 13:15:38 +0000 (13:15 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 17 Jul 2024 14:29:52 +0000 (14:29 +0000)
- Added note to release-checklist
- Created specialized DENC_START_OSD_REQID
- Use CEPH_RELEASE_SQUID (19) value

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit 6143b80ef7fd9730705ea564f72542caacf7e379)

doc/dev/release-checklists.rst
src/include/denc.h
src/osd/osd_types.h

index 8496131469adbe77b4bf2e3df17592ad97468753..dfcfd31d781f94de7d5322780631c9786bbe40a7 100644 (file)
@@ -105,6 +105,7 @@ Code cleanup
   `ceph_release_t::*`)
 - [ ] search code for `require_osd_release`
 - [ ] search code for `min_mon_release`
+- [ ] check include/denc.h if DENC_START macro still needs reference to squid
 
 QA suite
 --------
index cdc54a55129e8c54f3f0d855a53b6ce4c0bfe67f..c06bf46bf24da65c81076dcaf71e0586bedd039d 100644 (file)
@@ -53,6 +53,7 @@
 #include "common/error_code.h"
 #include "common/likely.h"
 #include "ceph_release.h"
+#include "include/rados.h"
 
 template<typename T, typename=void>
 struct denc_traits {
@@ -1862,17 +1863,28 @@ inline std::enable_if_t<traits::supported && !traits::featured> decode_nohead(
   __u8 struct_compat = compat;                                         \
   char *_denc_pchar;                                                   \
   uint32_t _denc_u32;                                                  \
-  static_assert(CEPH_RELEASE >= (19/*squid*/ + 2) || compat == 1);     \
+  static_assert(CEPH_RELEASE >= (CEPH_RELEASE_SQUID /*19*/ + 2) || compat == 1);       \
   _denc_start(p, &struct_v, &struct_compat, &_denc_pchar, &_denc_u32); \
   do {
 
-// For the only type that is with compat 2, osd_reqid_t, and unittest.
+// For the only type that is with compat 2: unittest.
 #define DENC_START_COMPAT_2(v, compat, p)                              \
   __u8 struct_v = v;                                                   \
   __u8 struct_compat = compat;                                         \
   char *_denc_pchar;                                                   \
   uint32_t _denc_u32;                                                  \
-  static_assert(CEPH_RELEASE >= (19/*squid*/ + 2) || compat == 2);     \
+  static_assert(CEPH_RELEASE >= (CEPH_RELEASE_SQUID /*19*/ + 2) || compat == 2);       \
+  _denc_start(p, &struct_v, &struct_compat, &_denc_pchar, &_denc_u32); \
+  do {
+
+// For osd_reqid_t which cannot be upgraded at all.
+// We used it to communicate with clients and now we cannot safely upgrade.
+#define DENC_START_OSD_REQID(v, compat, p)                             \
+  __u8 struct_v = v;                                                   \
+  __u8 struct_compat = compat;                                         \
+  char *_denc_pchar;                                                   \
+  uint32_t _denc_u32;                                                  \
+  static_assert(compat == 2, "osd_reqid_t cannot be upgraded");                \
   _denc_start(p, &struct_v, &struct_compat, &_denc_pchar, &_denc_u32); \
   do {
 
index 2427fc9ab10f084044b6b3b91254151b128ebf80..4ea254dc8710cb8f818b5d0eab91457447c11f24 100644 (file)
@@ -164,7 +164,7 @@ struct osd_reqid_t {
   {}
 
   DENC(osd_reqid_t, v, p) {
-    DENC_START_COMPAT_2(2, 2, p);
+    DENC_START_OSD_REQID(2, 2, p);
     denc(v.name, p);
     denc(v.tid, p);
     denc(v.inc, p);