Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-5974

Remove checksum compatibility with Lustre 1.8

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.8.0
    • Lustre 2.8.0
    • 3
    • 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
      

      Attachments

        Issue Links

          Activity

            People

              yujian Jian Yu
              jamesanunez James Nunez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: