From fdd2c5d3a6e5f866e5ca887064e9ed37316af234 Mon Sep 17 00:00:00 2001 From: Qian Yingjin Date: Thu, 28 Feb 2019 16:05:29 +0800 Subject: [PATCH] LU-12021 lsom: Add an OBD_CONNECT2_LSOM connect flag Add an OBD_CONNECT2_LSOM connect flag so that clients do not send MDS_ATTR_LSIZE and MDS_ATTR_LBLOCKS flags to the old servers that do not support them. Signed-off-by: Qian Yingjin Change-Id: I266c74e56c2cb1462e204d6fd4f1399f10621416 Reviewed-on: https://review.whamcloud.com/34343 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Wang Shilong Reviewed-by: Aurelien Degremont --- lustre/include/uapi/linux/lustre/lustre_idl.h | 4 +++- lustre/llite/llite_lib.c | 3 ++- lustre/mdc/mdc_request.c | 3 +++ lustre/mdt/mdt_lib.c | 2 +- lustre/obdclass/lprocfs_status.c | 4 +++- lustre/ptlrpc/wiretest.c | 2 ++ lustre/utils/wirecheck.c | 1 + lustre/utils/wiretest.c | 2 ++ 8 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index aca742b..4c697d4 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -834,6 +834,7 @@ struct ptlrpc_body_v2 { #define OBD_CONNECT2_LOCK_CONVERT 0x80ULL /* IBITS lock convert support */ #define OBD_CONNECT2_ARCHIVE_ID_ARRAY 0x100ULL /* store HSM archive_id in array */ #define OBD_CONNECT2_SELINUX_POLICY 0x400ULL /* has client SELinux policy */ +#define OBD_CONNECT2_LSOM 0x800ULL /* LSOM support */ /* XXX README XXX: * Please DO NOT add flag values here before first ensuring that this same @@ -889,7 +890,8 @@ struct ptlrpc_body_v2 { OBD_CONNECT2_LOCK_CONVERT | \ OBD_CONNECT2_DIR_MIGRATE | \ OBD_CONNECT2_ARCHIVE_ID_ARRAY | \ - OBD_CONNECT2_SELINUX_POLICY) + OBD_CONNECT2_SELINUX_POLICY | \ + OBD_CONNECT2_LSOM) #define OST_CONNECT_SUPPORTED (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \ OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \ diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 7ec8695..97305de 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -228,7 +228,8 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, OBD_CONNECT2_LOCK_CONVERT | OBD_CONNECT2_DIR_MIGRATE | OBD_CONNECT2_SUM_STATFS | - OBD_CONNECT2_ARCHIVE_ID_ARRAY; + OBD_CONNECT2_ARCHIVE_ID_ARRAY | + OBD_CONNECT2_LSOM; #ifdef HAVE_LRU_RESIZE_SUPPORT if (sbi->ll_flags & LL_SBI_LRU_RESIZE) diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 8e85aeb..048c25a 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -937,6 +937,9 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data, req->rq_request_portal = MDS_READPAGE_PORTAL; ptlrpc_at_set_req_timeout(req); + if (!(exp_connect_flags2(exp) & OBD_CONNECT2_LSOM)) + op_data->op_xvalid &= ~(OP_XVALID_LAZYSIZE | + OP_XVALID_LAZYBLOCKS); mdc_close_pack(req, op_data); diff --git a/lustre/mdt/mdt_lib.c b/lustre/mdt/mdt_lib.c index 90123c4..428abef 100644 --- a/lustre/mdt/mdt_lib.c +++ b/lustre/mdt/mdt_lib.c @@ -995,7 +995,7 @@ static __u64 mdt_attr_valid_xlate(__u64 in, struct mdt_reint_record *rr, MDS_ATTR_FROM_OPEN | MDS_ATTR_LSIZE | MDS_ATTR_LBLOCKS | MDS_ATTR_OVERRIDE); if (in != 0) - CERROR("Unknown attr bits: %#llx\n", in); + CDEBUG(D_INFO, "Unknown attr bits: %#llx\n", in); return out; } diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index b352d6e..8894a38 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -782,7 +782,9 @@ static const char *obd_connect_names[] = { "wbc", /* 0x40 */ "lock_convert", /* 0x80 */ "archive_id_array", /* 0x100 */ - "selinux_policy", /* 0x200 */ + "unknown", /* 0x200 */ + "selinux_policy", /* 0x400 */ + "lsom", /* 0x800 */ NULL }; diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 0188129..2f9d7d9 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -1338,6 +1338,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_ARCHIVE_ID_ARRAY); LASSERTF(OBD_CONNECT2_SELINUX_POLICY == 0x400ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_SELINUX_POLICY); + LASSERTF(OBD_CONNECT2_LSOM == 0x800ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_LSOM); 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 dac04de..d3e3675 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -606,6 +606,7 @@ check_obd_connect_data(void) CHECK_DEFINE_64X(OBD_CONNECT2_LOCK_CONVERT); CHECK_DEFINE_64X(OBD_CONNECT2_ARCHIVE_ID_ARRAY); CHECK_DEFINE_64X(OBD_CONNECT2_SELINUX_POLICY); + CHECK_DEFINE_64X(OBD_CONNECT2_LSOM); 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 ec0c08c..c494c95 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -1360,6 +1360,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_ARCHIVE_ID_ARRAY); LASSERTF(OBD_CONNECT2_SELINUX_POLICY == 0x400ULL, "found 0x%.16llxULL\n", OBD_CONNECT2_SELINUX_POLICY); + LASSERTF(OBD_CONNECT2_LSOM == 0x800ULL, "found 0x%.16llxULL\n", + OBD_CONNECT2_LSOM); 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