Whamcloud - gitweb
LU-12275 sec: reserve flags for client side encryption 60/36360/5
authorSebastien Buisson <sbuisson@ddn.com>
Thu, 3 Oct 2019 14:35:11 +0000 (14:35 +0000)
committerOleg Drokin <green@whamcloud.com>
Tue, 22 Oct 2019 23:57:09 +0000 (23:57 +0000)
Reserve OBD_CONNECT2_ENC connection flag so that 'encrypt' or
'test_dummy_encryption' client mount options can only be used if
server side knows how to handle encrypted object size properly.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I42d0b597df3b68bd1de19394104e7fda1b76bf6c
Reviewed-on: https://review.whamcloud.com/36360
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/obdclass/lprocfs_status.c
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index 57dd526..0cca401 100644 (file)
@@ -839,15 +839,16 @@ struct ptlrpc_body_v2 {
 #define OBD_CONNECT2_LSOM              0x800ULL /* LSOM support */
 #define OBD_CONNECT2_PCC               0x1000ULL /* Persistent Client Cache */
 #define OBD_CONNECT2_ASYNC_DISCARD     0x4000ULL /* support async DoM data discard */
 #define OBD_CONNECT2_LSOM              0x800ULL /* LSOM support */
 #define OBD_CONNECT2_PCC               0x1000ULL /* Persistent Client Cache */
 #define OBD_CONNECT2_ASYNC_DISCARD     0x4000ULL /* support async DoM data discard */
-
+#define OBD_CONNECT2_ENCRYPT           0x8000ULL /* client-to-disk encrypt */
 /* XXX README XXX:
  * Please DO NOT add flag values here before first ensuring that this same
  * flag value is not in use on some other branch.  Please clear any such
  * changes with senior engineers before starting to use a new flag.  Then,
  * submit a small patch against EVERY branch that ONLY adds the new flag,
 /* XXX README XXX:
  * Please DO NOT add flag values here before first ensuring that this same
  * flag value is not in use on some other branch.  Please clear any such
  * changes with senior engineers before starting to use a new flag.  Then,
  * submit a small patch against EVERY branch that ONLY adds the new flag,
- * updates obd_connect_names[] for lprocfs_rd_connect_flags(), adds the
- * flag to check_obd_connect_data(), and updates wiretests accordingly, so it
- * can be approved and landed easily to reserve the flag for future use. */
+ * updates obd_connect_names[], adds the flag to check_obd_connect_data(),
+ * and updates wiretests accordingly, so it can be approved and landed easily
+ * to reserve the flag for future use.
+ */
 
 /* The MNE_SWAB flag is overloading the MDS_MDS bit only for the MGS
  * connection.  It is a temporary bug fix for Imperative Recovery interop
 
 /* The MNE_SWAB flag is overloading the MDS_MDS bit only for the MGS
  * connection.  It is a temporary bug fix for Imperative Recovery interop
index e85e395..11fdc78 100644 (file)
@@ -786,6 +786,7 @@ static const char *obd_connect_names[] = {
        "pcc",                  /* 0x1000 */
        "plain_layout",         /* 0x2000 */
        "async_discard",        /* 0x4000 */
        "pcc",                  /* 0x1000 */
        "plain_layout",         /* 0x2000 */
        "async_discard",        /* 0x4000 */
+       "client_encryption",    /* 0x8000 */
        NULL
 };
 
        NULL
 };
 
index 1d3f174..b6fa9ae 100644 (file)
@@ -1353,6 +1353,8 @@ void lustre_assert_wire_constants(void)
                 OBD_CONNECT2_PCC);
        LASSERTF(OBD_CONNECT2_ASYNC_DISCARD == 0x4000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_ASYNC_DISCARD);
                 OBD_CONNECT2_PCC);
        LASSERTF(OBD_CONNECT2_ASYNC_DISCARD == 0x4000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_ASYNC_DISCARD);
+       LASSERTF(OBD_CONNECT2_ENCRYPT == 0x8000ULL, "found 0x%.16llxULL\n",
+                OBD_CONNECT2_ENCRYPT);
        LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
                (unsigned)OBD_CKSUM_CRC32);
        LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
        LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
                (unsigned)OBD_CKSUM_CRC32);
        LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
index 5de1fbc..74e4a31 100644 (file)
@@ -494,9 +494,10 @@ check_ptlrpc_body(void)
  * flag value is not in use on some other branch.  Please clear any such
  * changes with senior engineers before starting to use a new flag.  Then,
  * submit a small patch against EVERY branch that ONLY adds the new flag,
  * flag value is not in use on some other branch.  Please clear any such
  * changes with senior engineers before starting to use a new flag.  Then,
  * submit a small patch against EVERY branch that ONLY adds the new flag,
- * updates obd_connect_names[] for lprocfs_rd_connect_flags(), adds the
- * flag to check_obd_connect_data(), and updates wiretests accordingly, so it
- * can be approved and landed easily to reserve the flag for future use. */
+ * updates obd_connect_names[], insert new value in lustre_idl.h, and updates
+ * wiretests accordingly, so it can be approved and landed easily to reserve
+ * the flag for future use.
+ */
 static void
 check_obd_connect_data(void)
 {
 static void
 check_obd_connect_data(void)
 {
@@ -611,6 +612,7 @@ check_obd_connect_data(void)
        CHECK_DEFINE_64X(OBD_CONNECT2_LSOM);
        CHECK_DEFINE_64X(OBD_CONNECT2_PCC);
        CHECK_DEFINE_64X(OBD_CONNECT2_ASYNC_DISCARD);
        CHECK_DEFINE_64X(OBD_CONNECT2_LSOM);
        CHECK_DEFINE_64X(OBD_CONNECT2_PCC);
        CHECK_DEFINE_64X(OBD_CONNECT2_ASYNC_DISCARD);
+       CHECK_DEFINE_64X(OBD_CONNECT2_ENCRYPT);
 
        CHECK_VALUE_X(OBD_CKSUM_CRC32);
        CHECK_VALUE_X(OBD_CKSUM_ADLER);
 
        CHECK_VALUE_X(OBD_CKSUM_CRC32);
        CHECK_VALUE_X(OBD_CKSUM_ADLER);
index 3cc6c32..2f7dc2f 100644 (file)
@@ -1374,6 +1374,8 @@ void lustre_assert_wire_constants(void)
                 OBD_CONNECT2_PCC);
        LASSERTF(OBD_CONNECT2_ASYNC_DISCARD == 0x4000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_ASYNC_DISCARD);
                 OBD_CONNECT2_PCC);
        LASSERTF(OBD_CONNECT2_ASYNC_DISCARD == 0x4000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_ASYNC_DISCARD);
+       LASSERTF(OBD_CONNECT2_ENCRYPT == 0x8000ULL, "found 0x%.16llxULL\n",
+                OBD_CONNECT2_ENCRYPT);
        LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
                (unsigned)OBD_CKSUM_CRC32);
        LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
        LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
                (unsigned)OBD_CKSUM_CRC32);
        LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",