Whamcloud - gitweb
LU-10855 ptlrpc: assign specific values to MGS opcodes 53/32653/2
authorAndreas Dilger <andreas.dilger@intel.com>
Wed, 6 Jun 2018 22:18:03 +0000 (16:18 -0600)
committerOleg Drokin <green@whamcloud.com>
Wed, 18 Jul 2018 06:00:41 +0000 (06:00 +0000)
Assign specific values to all of the MGS opcodes in enum mgs_cmd
so that these values do not change if a new items is added or one
is removed in the future.  These opcodes are part of the wire
protocol and need to remain constant.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I8132ca01916cd657933d0c8864e4e78f8b3ebbe5
Reviewed-on: https://review.whamcloud.com/32653
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index a7ce930..84b913b 100644 (file)
@@ -2455,16 +2455,16 @@ struct ldlm_reply {
  * Opcodes for mountconf (mgs and mgc)
  */
 enum mgs_cmd {
-        MGS_CONNECT = 250,
-        MGS_DISCONNECT,
-        MGS_EXCEPTION,         /* node died, etc. */
-        MGS_TARGET_REG,        /* whenever target starts up */
-        MGS_TARGET_DEL,
-        MGS_SET_INFO,
-        MGS_CONFIG_READ,
-        MGS_LAST_OPC
-};
-#define MGS_FIRST_OPC MGS_CONNECT
+       MGS_CONNECT     = 250,
+       MGS_DISCONNECT  = 251,
+       MGS_EXCEPTION   = 252,  /* node died, etc. */
+       MGS_TARGET_REG  = 253,  /* whenever target starts up */
+       MGS_TARGET_DEL  = 254,
+       MGS_SET_INFO    = 255,
+       MGS_CONFIG_READ = 256,
+       MGS_LAST_OPC,
+       MGS_FIRST_OPC   = MGS_CONNECT
+};
 
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
 #define MGS_PARAM_MAXLEN 1024
index 9aa4553..30ad1e4 100644 (file)
@@ -360,6 +360,8 @@ void lustre_assert_wire_constants(void)
                 (long long)MGS_TARGET_DEL);
        LASSERTF(MGS_SET_INFO == 255, "found %lld\n",
                 (long long)MGS_SET_INFO);
+       LASSERTF(MGS_CONFIG_READ == 256, "found %lld\n",
+                (long long)MGS_CONFIG_READ);
        LASSERTF(MGS_LAST_OPC == 257, "found %lld\n",
                 (long long)MGS_LAST_OPC);
        LASSERTF(SEC_CTX_INIT == 801, "found %lld\n",
index 178fc8f..4211cef 100644 (file)
@@ -2716,6 +2716,7 @@ main(int argc, char **argv)
        CHECK_VALUE(MGS_TARGET_REG);
        CHECK_VALUE(MGS_TARGET_DEL);
        CHECK_VALUE(MGS_SET_INFO);
+       CHECK_VALUE(MGS_CONFIG_READ);
        CHECK_VALUE(MGS_LAST_OPC);
 
        CHECK_VALUE(SEC_CTX_INIT);
index a83a3db..0ff5bbd 100644 (file)
@@ -381,6 +381,8 @@ void lustre_assert_wire_constants(void)
                 (long long)MGS_TARGET_DEL);
        LASSERTF(MGS_SET_INFO == 255, "found %lld\n",
                 (long long)MGS_SET_INFO);
+       LASSERTF(MGS_CONFIG_READ == 256, "found %lld\n",
+                (long long)MGS_CONFIG_READ);
        LASSERTF(MGS_LAST_OPC == 257, "found %lld\n",
                 (long long)MGS_LAST_OPC);
        LASSERTF(SEC_CTX_INIT == 801, "found %lld\n",