From 44a2092f08ca5f349659680b2c19d55d2365c842 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Sun, 20 May 2018 21:00:23 +0300 Subject: [PATCH] LU-10175 ptlrpc: add LOCK_CONVERT connection flag Add LOCK_CONVERT connection flag to don't use lock convert feature with old servers. Test-Parameters: trivial Signed-off-by: Mikhail Pershin Change-Id: Ie860f43955314017609774d692f89cfe3c2ab896 Reviewed-on: https://review.whamcloud.com/32593 Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo --- lustre/include/uapi/linux/lustre/lustre_idl.h | 1 + lustre/obdclass/lprocfs_status.c | 1 + lustre/ptlrpc/wiretest.c | 2 ++ lustre/utils/wirecheck.c | 1 + lustre/utils/wiretest.c | 4 +++- 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index 11ea4d3..1c821a0 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -808,6 +808,7 @@ struct ptlrpc_body_v2 { #define OBD_CONNECT2_DIR_MIGRATE 0x4ULL /* migrate striped dir */ #define OBD_CONNECT2_FLR 0x20ULL /* FLR support */ #define OBD_CONNECT2_WBC_INTENTS 0x40ULL /* create/unlink/... intents for wbc, also operations under client-held parent locks */ +#define OBD_CONNECT2_LOCK_CONVERT 0x80ULL /* IBITS lock convert support */ /* XXX README XXX: * Please DO NOT add flag values here before first ensuring that this same diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 1c30d87..fbe115a 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -807,6 +807,7 @@ static const char *obd_connect_names[] = { "unknown", /* 0x10 */ "flr", /* 0x20 */ "wbc", /* 0x40 */ + "lock_convert", /* 0x80 */ NULL }; diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 0adfdba..e44d933 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -1308,6 +1308,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_FLR); LASSERTF(OBD_CONNECT2_WBC_INTENTS == 0x40ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_WBC_INTENTS); + LASSERTF(OBD_CONNECT2_LOCK_CONVERT == 0x80ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_LOCK_CONVERT); 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 67efc67..72151df 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -590,6 +590,7 @@ check_obd_connect_data(void) CHECK_DEFINE_64X(OBD_CONNECT2_DIR_MIGRATE); CHECK_DEFINE_64X(OBD_CONNECT2_FLR); CHECK_DEFINE_64X(OBD_CONNECT2_WBC_INTENTS); + CHECK_DEFINE_64X(OBD_CONNECT2_LOCK_CONVERT); 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 777e224..0264979 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1325,10 +1325,12 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_LOCKAHEAD); LASSERTF(OBD_CONNECT2_DIR_MIGRATE == 0x4ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_DIR_MIGRATE); - LASSERTF(OBD_CONNECT2_FLR == 0x20ULL, "found 0x%.16llxULL\n", + LASSERTF(OBD_CONNECT2_FLR == 0x20ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_FLR); LASSERTF(OBD_CONNECT2_WBC_INTENTS == 0x40ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_WBC_INTENTS); + LASSERTF(OBD_CONNECT2_LOCK_CONVERT == 0x80ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_LOCK_CONVERT); 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