From: Giuseppe Di Natale Date: Fri, 21 Aug 2015 22:57:40 +0000 (-0700) Subject: LU-5974 ptlrpc: Removed checksum compatibility with 1.8 X-Git-Tag: 2.7.60~49 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=02e2a3ccf2a3410610af5a4193cc23bc2c84fb5c LU-5974 ptlrpc: Removed checksum compatibility with 1.8 Removed version checks which enabled checksum compatibility with Lustre version 1.8 Signed-off-by: Giuseppe Di Natale Change-Id: I15895cd7236c4c864a8597faf2c43d1548cfcfb2 Reviewed-on: http://review.whamcloud.com/16076 Reviewed-by: Christopher J. Morrone Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo --- diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index 82bc028..b06073b 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -2360,11 +2360,7 @@ __u32 lustre_msg_get_service_time(struct lustre_msg *msg); char *lustre_msg_get_jobid(struct lustre_msg *msg); __u32 lustre_msg_get_cksum(struct lustre_msg *msg); __u64 lustre_msg_get_mbits(struct lustre_msg *msg); -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0) -__u32 lustre_msg_calc_cksum(struct lustre_msg *msg, int compat18); -#else __u32 lustre_msg_calc_cksum(struct lustre_msg *msg); -#endif void lustre_msg_set_handle(struct lustre_msg *msg,struct lustre_handle *handle); void lustre_msg_set_type(struct lustre_msg *msg, __u32 type); void lustre_msg_set_opc(struct lustre_msg *msg, __u32 opc); diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index dfff4b2..5898859 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -1292,29 +1292,13 @@ __u64 lustre_msg_get_mbits(struct lustre_msg *msg) } } -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0) -/* - * In 1.6 and 1.8 the checksum was computed only on struct ptlrpc_body as - * it was in 1.6 (88 bytes, smaller than the full size in 1.8). It makes - * more sense to compute the checksum on the full ptlrpc_body, regardless - * of what size it is, but in order to keep interoperability with 1.8 we - * can optionally also checksum only the first 88 bytes (caller decides). */ -# define ptlrpc_body_cksum_size_compat18 88 - -__u32 lustre_msg_calc_cksum(struct lustre_msg *msg, int compat18) -#else __u32 lustre_msg_calc_cksum(struct lustre_msg *msg) -#endif { switch (msg->lm_magic) { case LUSTRE_MSG_MAGIC_V2: { struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0) - __u32 len = compat18 ? ptlrpc_body_cksum_size_compat18 : - lustre_msg_buflen(msg, MSG_PTLRPC_BODY_OFF); -#else __u32 len = lustre_msg_buflen(msg, MSG_PTLRPC_BODY_OFF); -#endif + unsigned int hsize = 4; __u32 crc; diff --git a/lustre/ptlrpc/sec_null.c b/lustre/ptlrpc/sec_null.c index d661ee3..e5e8771 100644 --- a/lustre/ptlrpc/sec_null.c +++ b/lustre/ptlrpc/sec_null.c @@ -103,15 +103,8 @@ int null_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req) if (req->rq_early) { cksums = lustre_msg_get_cksum(req->rq_repdata); -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0) - if (lustre_msghdr_get_flags(req->rq_reqmsg) & - MSGHDR_CKSUM_INCOMPAT18) - cksumc = lustre_msg_calc_cksum(req->rq_repmsg, 0); - else - cksumc = lustre_msg_calc_cksum(req->rq_repmsg, 1); -#else cksumc = lustre_msg_calc_cksum(req->rq_repmsg); -#endif + if (cksumc != cksums) { CDEBUG(D_SEC, "early reply checksum mismatch: %08x != %08x\n", @@ -372,15 +365,7 @@ int null_authorize(struct ptlrpc_request *req) } else { __u32 cksum; -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0) - if (lustre_msghdr_get_flags(req->rq_reqmsg) & - MSGHDR_CKSUM_INCOMPAT18) - cksum = lustre_msg_calc_cksum(rs->rs_repbuf, 0); - else - cksum = lustre_msg_calc_cksum(rs->rs_repbuf, 1); -#else cksum = lustre_msg_calc_cksum(rs->rs_repbuf); -#endif lustre_msg_set_cksum(rs->rs_repbuf, cksum); req->rq_reply_off = 0; }