[LU-5974] Remove checksum compatibility with Lustre 1.8 Created: 03/Dec/14  Updated: 08/Sep/15  Resolved: 03/Sep/15

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.8.0
Fix Version/s: Lustre 2.8.0

Type: Bug Priority: Minor
Reporter: James Nunez (Inactive) Assignee: Jian Yu
Resolution: Fixed Votes: 0
Labels: easy, patch

Issue Links:
Related
is related to LU-6349 remove old protocol compatibility Resolved
Severity: 3
Rank (Obsolete): 16687

 Description   

From comments in the Lustre code, file lustre/ptlrpc/pack_generic.c,

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).

In Lustre 2.8, tag 2.7.53 and above, checksum compatibility with Lustre 1.8 goes away. If it is not desirable to end compatibility with Lustre 1.8, the following code needs to be modified else it can be removed.

In lustre/include/lustre_net.h, using LUSTRE_VERSION_CODE, the checksum compatibility input flag is dropped in the definition of lustre_msg_calc_cksum(); the int “compat18” flag is dropped.

#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

In file lustre/ptlrpc/pack_generic.c, the definition of lustre_msg_calc_cksum() changes based on what version of Lustre is running:

#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

In file lustre/ptlrpc/sec_null.c, in function null_ctx_verify():

#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

and in null_authorize(),

#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


 Comments   
Comment by Gerrit Updater [ 25/Aug/15 ]

Giuseppe Di Natale (dinatale2@llnl.gov) uploaded a new patch: http://review.whamcloud.com/16076
Subject: LU-5974 ptlrpc: Removed checksum compatibility with 1.8
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: c39f8570522d8272db5843164fc5c01738f8287b

Comment by Gerrit Updater [ 03/Sep/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/16076/
Subject: LU-5974 ptlrpc: Removed checksum compatibility with 1.8
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 02e2a3ccf2a3410610af5a4193cc23bc2c84fb5c

Comment by Joseph Gmitter (Inactive) [ 03/Sep/15 ]

Landed for 2.8.

Generated at Sat Feb 10 01:56:07 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.