From 25c24649c49a6feea5f75a80125d08892f6b1657 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Tue, 13 Mar 2012 13:26:05 -0600 Subject: [PATCH] LU-974 protocol: change OBD_CONNECT_GRANT_PARAM 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 Change-Id: I503892c3b595c0272b0941fa58a16a49631ecab0 Reviewed-on: http://review.whamcloud.com/2297 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Johann Lombardi Reviewed-by: Oleg Drokin --- lustre/include/lustre/lustre_idl.h | 30 ++++++++++++++++++++---------- lustre/obdclass/lprocfs_status.c | 2 ++ lustre/ptlrpc/wiretest.c | 6 ++++-- lustre/utils/wirecheck.c | 3 ++- lustre/utils/wiretest.c | 6 ++++-- 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index cee5f58..01c5f41 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -1112,25 +1112,28 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); #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 */ -#define OBD_CONNECT_GRANT_PARAM 0x40000000000ULL /* additional grant parameters - * are passed at connect time - * to have finer grant space - * allocation */ -#define OBD_CONNECT_EINPROGRESS 0x80000000000ULL /* client can handle the - * -EINPROGRESS error for write - * RPC properly */ +#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. */ #define OCD_HAS_FLAG(ocd, flg) \ (!!((ocd)->ocd_connect_flags & OBD_CONNECT_##flg)) -/* also update obd_connect_names[] for lprocfs_rd_connect_flags() - * and lustre/utils/wirecheck.c */ #ifdef HAVE_LRU_RESIZE_SUPPORT #define LRU_RESIZE_CONNECT_FLAG OBD_CONNECT_LRU_RESIZE @@ -1240,6 +1243,13 @@ struct obd_connect_data { __u64 paddingE; /* added 2.1.0. also fix lustre_swab_connect */ __u64 paddingF; /* added 2.1.0. also fix lustre_swab_connect */ }; +/* XXX README XXX: + * Please DO NOT use any fields 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); diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 9016914..921f907 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -811,6 +811,8 @@ static const char *obd_connect_names[] = { "object_max_bytes", "imp_recov", "jobstats", + "umask", + "einprogress", "grant_param", NULL }; diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 6a6e7d9..4715af1 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -1001,10 +1001,12 @@ void lustre_assert_wire_constants(void) OBD_CONNECT_IMP_RECOV); LASSERTF(OBD_CONNECT_JOBSTATS == 0x20000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT_JOBSTATS); - LASSERTF(OBD_CONNECT_GRANT_PARAM == 0x40000000000ULL, "found 0x%.16llxULL\n", - OBD_CONNECT_GRANT_PARAM); + LASSERTF(OBD_CONNECT_UMASK == 0x40000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_UMASK); LASSERTF(OBD_CONNECT_EINPROGRESS == 0x80000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT_EINPROGRESS); + LASSERTF(OBD_CONNECT_GRANT_PARAM == 0x100000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_GRANT_PARAM); LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n", (unsigned)OBD_CKSUM_CRC32); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n", diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index 9733c6f..f7e8c2c 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -450,8 +450,9 @@ check_obd_connect_data(void) CHECK_DEFINE_64X(OBD_CONNECT_MAXBYTES); CHECK_DEFINE_64X(OBD_CONNECT_IMP_RECOV); CHECK_DEFINE_64X(OBD_CONNECT_JOBSTATS); - CHECK_DEFINE_64X(OBD_CONNECT_GRANT_PARAM); + CHECK_DEFINE_64X(OBD_CONNECT_UMASK); CHECK_DEFINE_64X(OBD_CONNECT_EINPROGRESS); + CHECK_DEFINE_64X(OBD_CONNECT_GRANT_PARAM); CHECK_VALUE_X(OBD_CKSUM_CRC32); CHECK_VALUE_X(OBD_CKSUM_ADLER); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index a961311..adef507 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1007,10 +1007,12 @@ void lustre_assert_wire_constants(void) OBD_CONNECT_IMP_RECOV); LASSERTF(OBD_CONNECT_JOBSTATS == 0x20000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT_JOBSTATS); - LASSERTF(OBD_CONNECT_GRANT_PARAM == 0x40000000000ULL, "found 0x%.16llxULL\n", - OBD_CONNECT_GRANT_PARAM); + LASSERTF(OBD_CONNECT_UMASK == 0x40000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_UMASK); LASSERTF(OBD_CONNECT_EINPROGRESS == 0x80000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT_EINPROGRESS); + LASSERTF(OBD_CONNECT_GRANT_PARAM == 0x100000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_GRANT_PARAM); LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n", (unsigned)OBD_CKSUM_CRC32); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n", -- 1.8.3.1