Whamcloud - gitweb
LU-974 protocol: change OBD_CONNECT_GRANT_PARAM
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 13 Mar 2012 20:31:38 +0000 (14:31 -0600)
committerJohann Lombardi <johann@whamcloud.com>
Thu, 29 Mar 2012 07:21:29 +0000 (03:21 -0400)
Change the OBD_CONNECT_GRANT_PARAM flag value to avoid conflict
with the OBD_CONNECT_UMASK flag from LU-974.  While that patch is
not yet landed to our release tree, it is in use in production at
some customers.  While the risk of conflict is currently low, it
is easier to change the GRANT_PARAM value since only in use on the
orion branch, and isn't even handled by the client there yet.

Add (hopefully) clear comments for OBD_CONNECT and obd_connect_data
to ensure that they are not modified in some incompatible way across
branches.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I503892c3b595c0272b0941fa58a16a496318cab0
Reviewed-on: http://review.whamcloud.com/2298
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/include/lustre/lustre_idl.h
lustre/obdclass/lprocfs_status.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index 414427b..bc5819f 100644 (file)
@@ -360,14 +360,24 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb, int msgsize);
 #define OBD_CONNECT_SKIP_ORPHAN   0x400000000ULL /* don't reuse orphan objids */
 #define OBD_CONNECT_MAX_EASIZE    0x800000000ULL /* preserved for large EA */
 #define OBD_CONNECT_FULL20       0x1000000000ULL /* it is 2.0 client */
-#define OBD_CONNECT_LAYOUTLOCK   0x2000000000ULL /* client supports layout lock */
+#define OBD_CONNECT_LAYOUTLOCK   0x2000000000ULL /* client uses layout lock */
 #define OBD_CONNECT_64BITHASH    0x4000000000ULL /* client supports 64-bits
                                                   * directory hash */
 #define OBD_CONNECT_MAXBYTES     0x8000000000ULL /* max stripe size */
 #define OBD_CONNECT_IMP_RECOV   0x10000000000ULL /* imp recovery support */
 #define OBD_CONNECT_JOBSTATS    0x20000000000ULL /* jobid in ptlrpc_body */
-/* also update obd_connect_names[] for lprocfs_rd_connect_flags()
- * and lustre/utils/wirecheck.c */
+#define OBD_CONNECT_UMASK       0x40000000000ULL /* create uses client umask */
+#define OBD_CONNECT_EINPROGRESS 0x80000000000ULL /* client handles -EINPROGRESS
+                                                  * write RPC error properly */
+#define OBD_CONNECT_GRANT_PARAM 0x100000000000ULL/* extra grant params used for
+                                                  * finer space reservation */
+/* 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
+ * and updates obd_connect_names[] for lprocfs_rd_connect_flags(), so it
+ * can be approved and landed easily to reserve the flag for future use. */
 
 #ifdef HAVE_LRU_RESIZE_SUPPORT
 #define LRU_RESIZE_CONNECT_FLAG OBD_CONNECT_LRU_RESIZE
@@ -411,15 +421,24 @@ struct obd_connect_data {
         __u32 ocd_index;         /* LOV index to connect to */
         __u32 ocd_brw_size;      /* Maximum BRW size in bytes */
         __u64 ocd_ibits_known;   /* inode bits this client understands */
-        __u32 ocd_nllu;          /* non-local-lustre-user */
-        __u32 ocd_nllg;          /* non-local-lustre-group */
-        __u64 ocd_transno;       /* Used in lustre 1.8 */
-        __u32 ocd_group;         /* Used in lustre 1.8 */
+        __u8  ocd_blocksize;     /* log2 of the backend fs blocksize: 2.3 */
+        __u8  ocd_inodespace;    /* log2 of the per-inode space used: 2.3 */
+        __u16 ocd_grant_extent;  /* per-extent grant overhead, 1K blocks: 2.3 */
+        __u32 ocd_unused;        /* also fix lustre_swab_connect */
+        __u64 ocd_transno;       /* first client transno to be replayed: 2.0 */
+        __u32 ocd_group;         /* MDS group on OST, 2.x*/
         __u32 ocd_cksum_types;   /* supported checksum algorithms */
-        __u32 ocd_max_easize;    /* How big LOV EA size can be on MDS */
-        __u32 ocd_instance;      /* IR instance # of this target */
-        __u64 ocd_maxbytes;      /* Maximum object size in bytes */
+        __u32 ocd_max_easize;    /* How big LOV EA size can be on MDS: 2.2 */
+        __u32 ocd_instance;      /* IR instance # of this target: 2.2 */
+        __u64 ocd_maxbytes;      /* Maximum object size in bytes: 2.1 */
 };
+/* XXX README XXX:
+ * Please DO NOT add any field here before first ensuring that this same
+ * field is not in use on some other branch.  Please clear any such changes
+ * with senior engineers before starting to use a new field.  Then, submit
+ * a small patch against EVERY branch that ONLY adds the new field along with
+ * the matching OBD_CONNECT flag, so that can be approved and landed easily to
+ * reserve the flag for future use. */
 
 extern void lustre_swab_connect(struct obd_connect_data *ocd);
 
index e9e4761..ec5ce20 100644 (file)
@@ -753,6 +753,12 @@ static const char *obd_connect_names[] = {
         "full20",
         "layout_lock",
         "64bithash",
+        "object_max_bytes",
+        "imp_recov",
+        "jobstats",
+        "umask",
+        "einprogress",
+        "grant_param",
         NULL
 };
 
index 603170f..89fffd1 100644 (file)
@@ -1974,8 +1974,10 @@ void lustre_swab_connect(struct obd_connect_data *ocd)
         __swab32s(&ocd->ocd_index);
         __swab32s(&ocd->ocd_brw_size);
         __swab64s(&ocd->ocd_ibits_known);
-        __swab32s(&ocd->ocd_nllu);
-        __swab32s(&ocd->ocd_nllg);
+        /* ocd_blocksize and ocd_inodespace don't need to be swabbed because
+         * they are 1-byte values */
+        __swab16s(&ocd->ocd_grant_extent);
+        CLASSERT(offsetof(typeof(*ocd), ocd_unused) != 0);
         __swab64s(&ocd->ocd_transno);
         __swab32s(&ocd->ocd_group);
         __swab32s(&ocd->ocd_cksum_types);
index d01a0d6..e5af897 100644 (file)
@@ -496,14 +496,22 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obd_connect_data, ocd_ibits_known));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_nllu) == 32, " found %lld\n",
-                 (long long)(int)offsetof(struct obd_connect_data, ocd_nllu));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_nllu) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_nllu));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_nllg) == 36, " found %lld\n",
-                 (long long)(int)offsetof(struct obd_connect_data, ocd_nllg));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_nllg) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_nllg));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_blocksize) == 32, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_blocksize));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize) == 1, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_inodespace) == 33, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_inodespace));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace) == 1, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_grant_extent) == 34, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_grant_extent));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent) == 2, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_unused) == 36, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_unused));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_unused) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_unused));
         LASSERTF((int)offsetof(struct obd_connect_data, ocd_transno) == 40, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_transno));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_transno) == 8, " found %lld\n",
@@ -565,6 +573,12 @@ void lustre_assert_wire_constants(void)
         CLASSERT(OBD_CONNECT_FULL20 == 0x1000000000ULL);
         CLASSERT(OBD_CONNECT_LAYOUTLOCK == 0x2000000000ULL);
         CLASSERT(OBD_CONNECT_64BITHASH == 0x4000000000ULL);
+        CLASSERT(OBD_CONNECT_MAXBYTES == 0x8000000000ULL);
+        CLASSERT(OBD_CONNECT_IMP_RECOV == 0x10000000000ULL);
+        CLASSERT(OBD_CONNECT_JOBSTATS == 0x20000000000ULL);
+        CLASSERT(OBD_CONNECT_UMASK == 0x40000000000ULL);
+        CLASSERT(OBD_CONNECT_EINPROGRESS == 0x80000000000ULL);
+        CLASSERT(OBD_CONNECT_GRANT_PARAM == 0x100000000000ULL);
 
         /* Checks for struct obdo */
         LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n",
index ddc4b59..71bb311 100644 (file)
@@ -208,8 +208,10 @@ static void check_obd_connect_data(void)
         CHECK_MEMBER(obd_connect_data, ocd_index);
         CHECK_MEMBER(obd_connect_data, ocd_brw_size);
         CHECK_MEMBER(obd_connect_data, ocd_ibits_known);
-        CHECK_MEMBER(obd_connect_data, ocd_nllu);
-        CHECK_MEMBER(obd_connect_data, ocd_nllg);
+        CHECK_MEMBER(obd_connect_data, ocd_blocksize);
+        CHECK_MEMBER(obd_connect_data, ocd_inodespace);
+        CHECK_MEMBER(obd_connect_data, ocd_grant_extent);
+        CHECK_MEMBER(obd_connect_data, ocd_unused);
         CHECK_MEMBER(obd_connect_data, ocd_transno);
         CHECK_MEMBER(obd_connect_data, ocd_group);
         CHECK_MEMBER(obd_connect_data, ocd_cksum_types);
@@ -254,6 +256,12 @@ static void check_obd_connect_data(void)
         CHECK_CDEFINE(OBD_CONNECT_FULL20);
         CHECK_CDEFINE(OBD_CONNECT_LAYOUTLOCK);
         CHECK_CDEFINE(OBD_CONNECT_64BITHASH);
+        CHECK_CDEFINE(OBD_CONNECT_MAXBYTES);
+        CHECK_CDEFINE(OBD_CONNECT_IMP_RECOV);
+        CHECK_CDEFINE(OBD_CONNECT_JOBSTATS);
+        CHECK_CDEFINE(OBD_CONNECT_UMASK);
+        CHECK_CDEFINE(OBD_CONNECT_EINPROGRESS);
+        CHECK_CDEFINE(OBD_CONNECT_GRANT_PARAM);
 }
 
 static void
index 88f5390..b9903fb 100644 (file)
@@ -494,14 +494,22 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obd_connect_data, ocd_ibits_known));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_ibits_known));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_nllu) == 32, " found %lld\n",
-                 (long long)(int)offsetof(struct obd_connect_data, ocd_nllu));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_nllu) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_nllu));
-        LASSERTF((int)offsetof(struct obd_connect_data, ocd_nllg) == 36, " found %lld\n",
-                 (long long)(int)offsetof(struct obd_connect_data, ocd_nllg));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_nllg) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_nllg));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_blocksize) == 32, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_blocksize));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize) == 1, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_blocksize));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_inodespace) == 33, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_inodespace));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace) == 1, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_inodespace));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_grant_extent) == 34, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_grant_extent));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent) == 2, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_grant_extent));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_unused) == 36, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_unused));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_unused) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_unused));
         LASSERTF((int)offsetof(struct obd_connect_data, ocd_transno) == 40, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_transno));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_transno) == 8, " found %lld\n",
@@ -563,6 +571,12 @@ void lustre_assert_wire_constants(void)
         CLASSERT(OBD_CONNECT_FULL20 == 0x1000000000ULL);
         CLASSERT(OBD_CONNECT_LAYOUTLOCK == 0x2000000000ULL);
         CLASSERT(OBD_CONNECT_64BITHASH == 0x4000000000ULL);
+        CLASSERT(OBD_CONNECT_MAXBYTES == 0x8000000000ULL);
+        CLASSERT(OBD_CONNECT_IMP_RECOV == 0x10000000000ULL);
+        CLASSERT(OBD_CONNECT_JOBSTATS == 0x20000000000ULL);
+        CLASSERT(OBD_CONNECT_UMASK == 0x40000000000ULL);
+        CLASSERT(OBD_CONNECT_EINPROGRESS == 0x80000000000ULL);
+        CLASSERT(OBD_CONNECT_GRANT_PARAM == 0x100000000000ULL);
 
         /* Checks for struct obdo */
         LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n",